scripts

shell scripts
git clone git://git.bitsmanent.org/scripts
Log | Files | Refs | README

commit 6ee3fa1b1aa5bc783cf2b98dd495d2df6cb21071
parent 03f2153a03a2a2593989300085f136fdfdcbbe0c
Author: Claudio Alessi <smoppy@gmail.com>
Date:   Sun, 24 Dec 2017 22:02:28 +0100

[droid] Check if adb server is running.

Diffstat:
Msrc/droid | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/droid b/src/droid @@ -12,7 +12,11 @@ GRADLE_URL=https://services.gradle.org/distributions/gradle-2.3-bin.zip [ ! -f "local.properties" ] && export ANDROID_HOME="$SDKDIR" _adb() { - # XXX if adb is not running as root, it must be started first + pids="$(pgrep -f adb)" + if [ ${#pids} -eq 0 ]; then + echo "You need to start ADB first. Run $ADB start-server as root." + exit 1 + fi apk="./build/outputs/apk/$(basename $(pwd))-debug.apk" $ADB "$@" "$apk" }