kodev: add run android convenience shortcut (#3297)

pull/3298/head
Frans de Jonge 7 years ago committed by GitHub
parent db6c35c144
commit 59cfde8558

29
kodev

@ -1,6 +1,7 @@
#!/bin/bash
CURDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
VERSION=$(git describe HEAD)
function assert_ret_zero() {
if [ "$1" -ne 0 ]; then
@ -351,7 +352,7 @@ function kodev-wbuilder() {
function kodev-run() {
RUN_HELP_MSG="
usage: run <OPTIONS> <ARGS>
usage: run <OPTIONS> <TARGET>
OPTIONS:
@ -363,6 +364,10 @@ OPTIONS:
-s=FOO --simulate=FOO simulate dimension and other specs for a given device model
supported model: kobo-aura-one, kindle3, hidpi
--graph graph memory use (requires gnuplot)
TARGET:
android install and run KOReader on an Android device connected through ADB
"
screen_width=540
screen_height=720
@ -429,8 +434,26 @@ OPTIONS:
shift
done
case $1 in
android)
command -v adb >/dev/null && {
if [ ! ${no_build} ]; then
echo "[*] Building KOReader..."
echo "[*] Building KOReader for Android…"
kodev-release --ignore-translation android
fi
# clear logcat to get rid of useless cruft
adb logcat -c
# uninstall existing package to make sure *everything* is gone from memory
adb uninstall "org.koreader.launcher"
adb install "koreader-android-arm-linux-androideabi-${VERSION}.apk"
# there's no adb run so we do this…
adb shell monkey -p org.koreader.launcher -c android.intent.category.LAUNCHER 1
adb logcat
} || echo "Failed to find adb in PATH to interact with Android device."
;;
*)
if [ ! ${no_build} ]; then
echo "[*] Building KOReader…"
kodev-build
else
setup_env
@ -471,6 +494,8 @@ OPTIONS:
if [ ${graph_memory} ]; then
capture_ctrl_c
fi
;;
esac
}
function kodev-test() {

Loading…
Cancel
Save