Scene:
What if we don't have an available launcher on the phone or on the development page to display the APK, and we want to start it?
Way
At this point you need to start from the command line, and use the AM command from the command line to start need to know the corresponding APK specific package name and the main activity name, how do you know?
Use AAPT dump badging *.apk to see the program name, package name, and SDK used for this apk file. Example:
AAPT dump badging helloworld.apkpackage:name= ' <span style= "color: #ff0000;" >com.example.helloworld</span> ' versioncode= ' 1 ' versionname= ' 1.0 ' sdkversion: ' + ' targetsdkversion: ' ' Uses-permission: ' Android.permission.WRITE_EXTERNAL_STORAGE ' uses-permission: ' Android.permission.READ_ External_storage ' Application-label: ' HelloWorld ' application-icon-160: ' Res/drawable-mdpi/ic_launcher.png ' application-icon-240: ' res/drawable-hdpi/ic_launcher.png ' application-icon-320: ' Res/drawable-xhdpi/ic_ Launcher.png ' application-icon-480: ' res/drawable-xxhdpi/ic_launcher.png ' application:label= ' HelloWorld ' icon= ' res /drawable-mdpi/ic_launcher.png ' application-debuggablelaunchable-activity:name= ' <span style= "color: #ff0000;" >com.example.helloworld.MainActivity</span> ' label= ' HelloWorld ' icon= ' uses-feature: ' Android.hardware.touchscreen ' uses-implied-feature: ' Android.hardware.touchscreen ', ' assumed you require a touch screen unless explicitly made optional ' mainsupports-screens: ' small ' normal ' LARge ' XLarge ' supports-any-density: ' true ' locales: '--_--' densities: ' 160 ' 240 ' 320 ' 480 '
The red content is the package name and the main Page class name, combined with the AM command to start the corresponding program.
For example, adb shell am start-n com.example.helloworld/. Mainactivity
Specific am instructions can refer to the
http://blog.csdn.net/tiantianshangcha/article/details/41445775
Android command line launches "Unknown" APK