Last active
September 16, 2015 15:16
-
-
Save atakane/7549f5bb213edc99de79 to your computer and use it in GitHub Desktop.
Auto install .apk files on to the Genymotion's simulator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Genymotion app path | |
GM=/Applications/Genymotion.app/Contents/MacOS/player.app/Contents/MacOS/tools | |
#Process each file found in the source folder recursively | |
for f in "$@" | |
do | |
#installing the package | |
$GM/adb install -r "$f" | |
#finding the activities in the APK | |
pkg=$($GM/aapt dump badging "$f"|awk -F" " '/package/ {print $2}'|awk -F"'" '/name=/ {print $2}') | |
act=$($GM/aapt dump badging "$f"|awk -F" " '/launchable-activity/ {print $2}'|awk -F"'" '/name=/ {print $2}') | |
#starting the apk | |
$GM/adb shell am start -n $pkg/$act | |
#removing .apk from install location | |
rm "$f"; | |
done | |
#refs: | |
#http://stackoverflow.com/questions/6109234/how-to-run-not-only-install-an-android-application-using-apk-file | |
#http://apple.blogoverflow.com/2012/06/folder-actions-tutorial-automation-meet-the-filesystem/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment