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