Skip to content

Instantly share code, notes, and snippets.

@rygorous
Created May 19, 2016 03:16
Show Gist options
  • Save rygorous/578fb796f15373700c89182b073bcda2 to your computer and use it in GitHub Desktop.
Save rygorous/578fb796f15373700c89182b073bcda2 to your computer and use it in GitHub Desktop.
#!/bin/bash
# If we get interrupted, make sure to kill the whole process tree
trap 'trap - SIGTERM && kill 0' SIGINT SIGTERM
# Issue command to all devices in parallel
for DEVICE in `adb devices | awk '/\tdevice$/ { print $1 }'`; do
ANY_DEVICES=1
# Look up pretty name from serial number
NAME=`grep ^$DEVICE device_names | awk '{ print $2 }'`
if [[ $NAME == "" ]]; then NAME=$DEVICE; fi
# Run adb
adb -s $DEVICE 2>&1 $* | sed "s/^/[$NAME]\t/g" &
done
if [[ $ANY_DEVICES != 1 ]]; then
echo $0: no devices connected!
fi
# Wait until all jobs are complete
wait
#!/bin/sh
# Build
ndk-build || exit
ant debug || exit
# Install everywhere
./adbroadcast.sh install -r bin/NativeActivity-debug.apk
# Clear log
./adbroadcast.sh logcat -c
# Run activity and print log
./adbroadcast.sh shell am start -n com.radgametools.oodleandroid/android.app.NativeActivity
./adbroadcast.sh logcat -s oodle-example:*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment