ADB shell AM

Source: Internet
Author: User

AM (Activity Manager) is a tool for managing activity, initiating activity, services, sending broadcasts, and closing windows.

start activity:adb shell am start [options] <INTENT>

<intent>: Can be obtained in the app's Androidmanifest.xml

[Options]:-n class name,-a action,-d data,-m mime-type,-c category,-e Extended data, etc.)
See Http://developer.android.com/tools/help/adb.html#am for details.

Open the activity that sent the message
# adb shell am start-a Android.intent.action.SEND_MULTIPLE

#adb Shell am start-a android.intent.action.view-d http://www.6san.com/

#adb Shell am start-n com.haojike.test/. MyActivity

ADB shell am start-n com.magcomm.touch/. Touchletteractivity–es letter "E"

–es pass strings, and Ei,el,ez parameters.

start service:adb shell am startservice [options] <INTENT>

#adb Shell am startservice-a Com.haojike.test.action.ONESERVICE
#adb Shell am startservice-n com.haojike.test/. MyService

Force shutdown app:adb shell am force-stop <PACKAGE>

#adb Shell am Force-stop com.6san.test

Send broadcast:ADB shell AM Broadcast [options] <INTENT>
#adb Shell am Broadcast-a "action_finish"//Send broadcast off activity
#adb Shell am broadcast-a Android.intent.action.MASTER_CLEAR//Factory Reset

#adb Shell am broadcast-n com.6san.test/. Mybroadcast

Broadcast with parameters, analog mobile low-power environment: ADB shell am broadcast-a Android.intent.action.battery_changed–ei "level" 3–ei "scale" 100

#adb Shell am broadcast-a android.provider.telephony.secret_code-d android_secret_code://767*3855

start profiling: am Profile <PROCESS> start <FILE>

Stop Profiling:am profile <PROCESS> stop

Start monitoring: am Monitor [–gdb <port>]

–gdb:start Gdbserv on the given port at Crash/anr

start monitoring of instrument instances:adb shell AM instrument [options] <COMPONENT>

-e <key> <value>//For test options in the form of key-value pairs, there are several key-value pairs available in Android.

-R: Outputs the test results in the original form. This option is typically used with the-e perf true when performing a performance test.

<component>:-w <test_package_name>/<runner_class>//keep adb shell open until test is complete, <test_package_name > and <runner_class> Find in Androidmanifest.xml

-W Com.android.phone.tests/com.android.phone.runners.functionaltestrunner

Reprint Please specify Source:6san.com
Original address: http://www.6san.com/1262/

ADB shell AM

Related Article

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.