Skip to content

Instantly share code, notes, and snippets.

@Androguide
Created January 28, 2014 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Androguide/8664871 to your computer and use it in GitHub Desktop.
Save Androguide/8664871 to your computer and use it in GitHub Desktop.
Launch an Android app through adb using the apk name instead of the package name (e.g: launch-app.sh yourapp.apk)
pkg=$(aapt dump badging $1|awk -F" " '/package/ {print $2}'|awk -F"'" '/name=/ {print $2}')
act=$(aapt dump badging $1|awk -F" " '/launchable-activity/ {print $2}'|awk -F"'" '/name=/ {print $2}')
adb shell am start -n $pkg/$act
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment