When launching an app using the Android automated Test tool Monkeyrunner, you need to fill in the package name and activity of the program under test, there are two ways to view the app package name and the entry activity name:
method One: Using AAPT//aapt is a tool that comes with the SDK, in the Sdk\builds-tools\ directory
1. Take the ES file browser as an example, switch to the Aapt.exe directory in the command line execution: AAPT dump badging E:\apk\es3.apk
2. The following two lines in the results of the run are the application package name and the entry activity name
Package:name= ' Com.estrongs.android.pop '
Launchable-activity:name= ' com.estrongs.android.pop.view.FileExplorerActivity '
Note: The Android SDK directory search can be found Aapt.exe if no apktool can be downloaded.
method Two: View Androidmanifest.xml
1. Use Apktool to decompile app:apktool.bat D es3.apk E:\apk\es
2. Open Androidmanifest.xml
The Package property value for the manifest node is the app's bundle name: <manifest package= "Com.estrongs.android.pop" >
Find the activity that corresponds to Android.intent.action.MAIN and Android.intent.category.LAUNCHER, the activity that corresponds to Android: The Name property is both the entry activity names, as follows:
<activity android:theme= "@*android tyle/theme.notitlebar" android:label= "@string/app_name" Android:name= " Com.estrongs.android.pop.view.FileExplorerActivity ">
<intent-filter>
<action android:name= "Android.intent.action.MAIN"/>
<category android:name= "Android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
Android.intent.action.MAIN determines the activity that the application starts first
Android.intent.category.LAUNCHER determines whether the application appears in the program list
Android Developer View application package name and portal Activity name method