Android command line to start "unknown" APK
Scenario:
No launcher is available on the mobile phone or on the Development version to display the APK, and we want to start it again. What should we do?
Solution
At this time, you need to start from the command line. To start from the command line using the am command, you need to know the specific package name and main activity name of the corresponding APK. How do you know?
Use aapt dump badging *. apk to view the program name, package name, and sdk used for this apk file. Example:
aapt dump badging HelloWorld.apkpackage: name='com.example.helloworld' versionCode='1' versionName='1.0'sdkVersion:'18'targetSdkVersion:'19'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='com.example.helloworld.MainActivity' 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 homepage class name. Then, you can start the corresponding program by combining the am command.
Example: adb shell am start-n com. example. helloworld/. MainActivity
For specific am commands, refer
Http://blog.csdn.net/tiantianshangcha/article/details/41445775