In AndroidProgramIn addition, you can also start the program from the command line, using the command line tool AM.
The start method is
Wangwei @ wwg41d3 :~ $ ADB Shell
$ Su
# Am start-N {package name}/{package name}. {activity name}
The program entry class can be obtained from the androidmanifest. xml file of each application. Taking the calculator as an example, its
<Manifest xmlns: Android = "http://schemas.android.com/apk/res/android "...
Package = "com. Android. calculator2...
The start method of the calculator is as follows:# Am start-N com. Android. calculator2/COM. Android. calculator2.calculator
For the example project helloactivity, androidmanifest. XML is as follows:
<Manifest...
Package = "com. example. Android. helloactivity"…>
The startup method is as follows:
# Am start-N com. example. Android. helloactivity/COM. example. Android. helloactivity. helloactivity
Other application startup commands are as follows:
The start method of calendar is as follows:
# Am start-N com. Android. calendar/COM. Android. Calendar. launchactivity
The startup method of alarmclock is as follows:
# Am start-N com. Android. alarmclock/COM. Android. alarmclock. alarmclock
The startup methods of music and video are as follows:
# Am start-N com. Android. Music/COM. Android. Music. musicbrowseractivity
# Am start-N com. Android. Music/COM. Android. Music. videobrowseractivity
# Am start-N com. Android. Music/COM. Android. Music. mediaplaybackactivity
The start method of camera (CAMERA) is as follows:
# Am start-N com. Android. Camera/COM. Android. Camera. Camera
Browser is started as follows:
# Am start-N com. Android. Browser/COM. Android. browser. browseractivity
Generally, an Android Application corresponds to a project. It is worth noting that some projects have multiple activities, while some applications use one project. For example, in the android interface, music and video are two applications, but they all use the packages/apps/music project. The androidmanifest. xml file of this project contains different activities ).
Usage: am [subcommand] [Options]
Start an activity: am start [-D] <intent>
-D: Enable debugging
Send a broadcast intent: AM broadcast <intent>
Start an instrumentation: am instrument [flags] <component>
-R: Print raw results (otherwise decode report_key_streamresult)
-E <Name> <value>: Set argument <Name> to <value>
-P <File>: Write profiling data to <File>
-W: Wait for instrumentation to finish before returning
Start profiling: am profile <process> Start <File>
Stop profiling: am profile <process> stop
<Intent> specifications include these flags:
[-A <action>] [-D ] [-T <mime_type>]
[-C <Category> [-C <Category>]...]
[-E | -- es <extra_key> <extra_string_value>...]
[-- EZ <extra_key> <extra_boolean_value>...]
[-E | -- EI <extra_key> <extra_int_value>...]
[-N <component>] [-F <flags>] [<URI>]
The start method is
# Am start-N package name/package name. Activity name
The startup method can be obtained from the androidmanifest. xml file of each application.
The startup methods of music and video are as follows:
# Am start-N com. Android. Music/COM. Android. Music. musicbrowseractivity
# Am start-N com. Android. Music/COM. Android. Music. videobrowseractivity
# Am start-N com. Android. Music/COM. Android. Music. mediaplaybackactivity
The start method of camera (CAMERA) is as follows:
# Am start-N com. Android. Camera/COM. Android. Camera. Camera
Browser is started as follows:
# Am start-N com. Android. Browser/COM. Android. browser. browseractivity
Start the browser:
Am start-A Android. Intent. Action. View-D http://www.google.cn/
Call number:
Am start-A Android. Intent. Action. Call-D Tel: 10086
Start Google map to go directly to Beijing:
Am start-A Android. Intent. Action. View GEO: 0, 0? Q = Beijing
URL: http://greatverve.cnblogs.com/archive/2012/02/10/android-am.html