Skip to content

Instantly share code, notes, and snippets.

@chapko
Forked from andrew-aladev/build.sh
Last active November 23, 2016 11:10
Show Gist options
  • Save chapko/473a2e5cdec82ca82219bb5e91817c07 to your computer and use it in GitHub Desktop.
Save chapko/473a2e5cdec82ca82219bb5e91817c07 to your computer and use it in GitHub Desktop.
#!/bin/sh
dir=$(pwd)
pkg="com.example.ThaliTestApp"
activity="$pkg/.MainActivity"
devices=($(adb devices | awk '/\<device\>/ { print $1 }'))
function adb-all {
for device in "${devices[@]}"
do
adb -s "$device" "$@" &
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
# have not tested yet
# adb-all install -r $apk
# adb-all shell pm clear $pkg
# adb-all shell pm grant $pkg android.permission.ACCESS_COARSE_LOCATION
# adb-all shell am start -n $activity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment