Skip to content

Instantly share code, notes, and snippets.

@andrew-aladev
Last active November 23, 2016 10:57
Show Gist options
  • Save andrew-aladev/5c23a79b273c3b3578a914abdd038060 to your computer and use it in GitHub Desktop.
Save andrew-aladev/5c23a79b273c3b3578a914abdd038060 to your computer and use it in GitHub Desktop.
#!/bin/sh
dir=$(pwd)
pkg="com.example.ThaliTestApp"
activity="$pkg/.MainActivity"
devices=("ENU7N16425000183" "ENU7N16425000206")
function command {
for device in "${devices[@]}"
do
adb -s "$device" $1 &
done
wait
}
# cd ../ThaliTest
cordova build android --release --device
apk="./platforms/android/build/outputs/apk/android-release-unsigned.apk"
/usr/local/opt/android-sdk/build-tools/25.0.0/apksigner sign --ks ~/Documents/adb-release-key.jks --ks-pass="pass:123456" $apk
command "install -r $apk"
command "shell pm clear $pkg"
command "shell pm grant $pkg android.permission.ACCESS_COARSE_LOCATION"
command "shell am start -n $activity"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment