Android using AM command to implement in the command line to start the program detailed _android

Source: Internet
Author: User

In Android, in addition to starting a program from the interface, you can start the program from the command line, using the command-line tool AM.

Copy Code code as follows:

usage:am [subcommand] [options]

Start an activity:am start [-d]
-d:enable debugging

Send a broadcast intent:am broadcast

Start an INSTRUMENTATION:AM instrument [flags]
-r:print Raw Results (otherwise decode Report_key_streamresult)
-e:set argument to
-p:write Profiling data to
-w:wait for instrumentation to finish before returning

Start Profiling:am profile Start
Stop Profiling:am Profile Stop

Specifications include these flags:
[-A] [d] [-T]
[-C [-c] ...]
[-e|--es ...]
[--ez ...]
[-e|--ei ...]
[-N] [F] []


the method to start is
Copy Code code as follows:

# AM START-N Package (package) name/activities (activity) full path

How to view the full path of each activity in the package:
1, install and launch the "firmware toolbox"
2, into the "APP Manager", display all the installation programs in the system, long press the command line to start the program.
3, pop-up window select "Advanced Freeze", the program all the activity will be displayed
The activity has two display formats, one showing the full path directly, the other showing a relative path in parentheses, and the relative path plus the package name being the full path.

Several examples of initiating a specified program activity
The starting methods for music and video (musical and visual) are:

Copy Code code 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 Camera (camera) boot method is:
Copy Code code as follows:

# AM Start-n Com.android.camera/com.android.camera.camera

The Browser (browser) Startup method is:
Copy Code code as follows:

# AM Start-n com.android.browser/com.android.browser.browseractivity

Start Browser:
Copy Code code as follows:

Am Start-a android.intent.action.view-d http://www.google.cn/

Dial number:
Copy Code code as follows:

Am Start-a android.intent.action.call-d tel:10086

Start Google Map and navigate directly to Beijing:
Copy Code code as follows:

Am Start-a Android.intent.action.VIEW geo:0,0?q=beijing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.