Sunday, May 26, 2013

Android: Launch app via ADB

First, you need to know the app's package name, and the activity which you wanted to launch. You can look them up with one of the following methods:

1a) use aapt (Android Asset Packaging Tool)
   aapt dump badging <apk-path>
- or -

1b) use apktool to retrieve AndroidMainifest.xml from the apk
   apktool d <apk-path>

Once you know the package name and activity name, you can launch it by running:
adb shell am start -a android.intent.action.MAIN -n <package-name>/<activity-name>

No comments: