sbcl.sbcl/tools-for-build/android_run.sh
Gleefre 562a1a329a Add android build system (crosscompiling with NDK)
Uses NDK as C crosscompiler and ADB to run code on the target device.
Uses both :linux and :android features (android is almost a linux).

It also reserves a folder android-libs/ for putting precompiled
libraries to link agains (for example zstd for core compression).

See doc/internals-notes/Android-build.txt for more details
2023-04-21 15:08:19 -04:00

14 lines
510 B
Bash

android_run() {
adb push $1 /data/local/tmp/temp.out > /dev/null
adb shell chmod +x /data/local/tmp/temp.out > /dev/null
adb shell ./data/local/tmp/temp.out
adb shell rm /data/local/tmp/temp.out > /dev/null
}
android_run_for_exit_code() {
adb push $1 /data/local/tmp/$1 > /dev/null
adb shell chmod +x /data/local/tmp/$1 > /dev/null 2>&1
adb shell "echo input | ./data/local/tmp/$1 > /dev/null 2>&1 ; echo \"\$?\"" 2>/dev/null
adb shell rm /data/local/tmp/$1 > /dev/null 2>&1
}