Last active
August 29, 2015 13:56
-
-
Save reidbaker/9255040 to your computer and use it in GitHub Desktop.
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
##Launch default activity in apk## | |
# Commands are surrounded in triple quotes ''' | |
#'''adb shell am start -n <package name>/<activity name>''' will start activity | |
#'''`<command here>`''' will evaluate command in back ticks | |
#'''aapt dump badging <your apk file>.apk''' will print a bunch of things including the package and default activity | |
#'''grep -o "package.*[\.][a-zA-Z]*[\']\|launchable-activity.*[\.][a-zA-Z]*[\']"''' will match either the package or activity | |
#'''| grep -o "['][a-zA-Z\.].*[']"''' then strip out everything but what we want surrounded by quotes | |
#'''sed "s/'//g"''' strip quotes | |
#'''sed -n -e ":a" -e "$ s/\n/\//gp;N;b a"''' replace newline with forward slash | |
adb shell am start -n `aapt dump badging <your apk file>.apk | grep -o "package.*[\.][a-zA-Z]*[\']\|launchable-activity.*[\.][a-zA-Z]*[\']" | grep -o "['][a-zA-Z\.].*[']" | sed "s/'//g" | sed -n -e ":a" -e "$ s/\n/\//gp;N;b a"` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment