文章目录
  1. 1. am start
  2. 2. am startservice
  3. 3. am stopservice
  4. 4. am force-stop
  5. 5. am kill
  6. 6. am kill-all
  7. 7. am broadcast
  8. 8. am instrument
  9. 9. am profile start
  10. 10. am profile stop
  11. 11. am dumpheap
  12. 12. am set-debug-app
  13. 13. am clear-debug-app
  14. 14. am bug-report
  15. 15. am monitor
  16. 16. am hang
  17. 17. am restart
  18. 18. am idle-maintenance
  19. 19. am screen-compat
  20. 20. am to-uri
  21. 21. am to-intent-uri
  22. 22. am to-app-uri
  23. 23. am switch-user
  24. 24. am start-user
  25. 25. am stop-user
  26. 26. am stack start
  27. 27. am stack movetask
  28. 28. am stack resize
  29. 29. am stack list
  30. 30. am stack info
  31. 31. am lock-task
  32. 32. am lock-task stop
  33. 33. am get-config
  34. 34. intent
  35. 35. 分享与支持

来源:JiongBull’s Blog
微博:@JiongBull
GitHub:JiongBull

Activity Manager,可以启动activity、启动service、发送广播、停止进程等。

am start

1
am start [-D] [-W] [-P (FILE)] [--start-profiler (FILE)] [--sampling INTERVAL] [-R COUNT] [-S] [--opengl-trace] [--user (USER_ID) | current] (INTENT)

启动Activity。

  • -D 启用debug
  • -W 等待启动完成,输出启动耗时
  • --start-profiler (FILE) 启用分析器,并把结果保存到文件
  • --sampling INTERVAL 每隔INTERVAL指定的毫秒后取样分析,需要和--start-profiler一起使用
  • -P (FILE) 像上面一样,但是会在应用空闲时停止分析
  • -R COUNT Activity重复启动COUNT次,顶部的Activity会在每次重复启动前销毁
  • -S 启动Activity前强制停止目标app
  • --opengl-trace 启用追踪OpenGL方法
  • --user (USER_ID) | current 指定运行的用户,如果没有指定则以当前用户运行
  1. am start -n com.jiongbull.art.note/.chapter1.AActivity

    1
    2
    root@shamu:/ # am start -n com.jiongbull.art.note/.chapter1.AActivity
    Starting: Intent { cmp=com.jiongbull.art.note/.chapter1.AActivity }
  2. am start -D -n com.jiongbull.art.note/.chapter1.AActivity
    am debug

    1
    2
    root@shamu:/ # am start -D -n com.jiongbull.art.note/.chapter1.AActivity
    Starting: Intent { cmp=com.jiongbull.art.note/.chapter1.AActivity }
  3. am start -W -n com.jiongbull.art.note/.chapter1.AActivity

    1
    2
    3
    4
    5
    6
    7
    8
    root@shamu:/ # am start -W -n com.jiongbull.art.note/.chapter1.AActivity
    Starting: Intent { cmp=com.jiongbull.art.note/.chapter1.AActivity }
    Status: ok
    Activity: com.jiongbull.art.note/.chapter1.AActivity
    ThisTime: 189
    TotalTime: 189
    WaitTime: 191
    Complete
  4. am start —start-profiler /data/local/tmp/profiler.txt -n com.jiongbull.art.note/.chapter1.AActivity

    1
    2
    root@shamu:/ # am start --start-profiler /data/local/tmp/profiler.txt -n com.jiongbull.art.note/.chapter1.AActivity
    Starting: Intent { cmp=com.jiongbull.art.note/.chapter1.AActivity }
  5. am start —sampling 1000 —start-profiler /data/local/tmp/profiler.txt -n com.jiongbull.art.note/.chapter1.AActivity

    1
    2
    root@shamu:/ # am start --sampling 1000 --start-profiler /data/local/tmp/profiler.txt -n com.jiongbull.art.note/.chapter1.AActivity
    Starting: Intent { cmp=com.jiongbull.art.note/.chapter1.AActivity }
  6. am start -P /data/local/tmp/profiler.txt -n com.jiongbull.art.note/.chapter1.AActivity

    1
    2
    root@shamu:/ # am start -P /data/local/tmp/profiler.txt -n com.jiongbull.art.note/.chapter1.AActivity
    Starting: Intent { cmp=com.jiongbull.art.note/.chapter1.AActivity }
  7. am start -R 3 -n com.jiongbull.art.note/.chapter1.AActivity

    1
    2
    3
    4
    root@shamu:/ # am start -R 3 -n com.jiongbull.art.note/.chapter1.AActivity
    Starting: Intent { cmp=com.jiongbull.art.note/.chapter1.AActivity }
    Starting: Intent { flg=0x10000000 cmp=com.jiongbull.art.note/.chapter1.AActivity }
    Warning: Activity not started, its current task has been brought to the front
  8. am start -S -n com.jiongbull.art.note/.chapter1.AActivity

    1
    2
    3
    root@shamu:/ # am start -S -n com.jiongbull.art.note/.chapter1.AActivity
    Stopping: com.jiongbull.art.note
    Starting: Intent { cmp=com.jiongbull.art.note/.chapter1.AActivity }
  9. am start —opengl-trace -n com.jiongbull.art.note/.chapter1.AActivity

    1
    2
    root@shamu:/ # am start --opengl-trace -n com.jiongbull.art.note/.chapter1.AActivity
    Starting: Intent { cmp=com.jiongbull.art.note/.chapter1.AActivity }
  10. am start —user current -n com.jiongbull.art.note/.chapter1.AActivity

    1
    2
    root@shamu:/ # am start --user current -n com.jiongbull.art.note/.chapter1.AActivity
    Starting: Intent { cmp=com.jiongbull.art.note/.chapter1.AActivity }

am startservice

am startservice [--user (USER_ID) | current] (INTENT),启动Service,--user (USER_ID) | current指定运行的用户,如果没有指定则以当前用户运行。

  1. am startservice -n com.jiongbull.art.note/.chapter2.PayService

    1
    2
    root@shamu:/ # am startservice -n com.jiongbull.art.note/.chapter2.PayService
    Starting service: Intent { cmp=com.jiongbull.art.note/.chapter2.PayService }
  2. am startservice —user current -n com.jiongbull.art.note/.chapter2.PayService

    1
    2
    root@shamu:/ # am startservice --user current -n com.jiongbull.art.note/.chapter2.PayService
    Starting service: Intent { cmp=com.jiongbull.art.note/.chapter2.PayService }

am stopservice

am stopservice [--user (USER_ID) | current] (INTENT),停止Service,--user (USER_ID) | current指定运行的用户,如果没有指定则以当前用户运行。

  1. am stopservice -n com.jiongbull.art.note/.chapter2.PayService

    1
    2
    3
    root@shamu:/ # am stopservice -n com.jiongbull.art.note/.chapter2.PayService
    Stopping service: Intent { cmp=com.jiongbull.art.note/.chapter2.PayService }
    Service stopped
  2. am stopservice —user current -n com.jiongbull.art.note/.chapter2.PayService

    1
    2
    3
    root@shamu:/ # am stopservice --user current -n com.jiongbull.art.note/.chapter2.PayService
    Stopping service: Intent { cmp=com.jiongbull.art.note/.chapter2.PayService }
    Service stopped

am force-stop

am force-stop [--user (USER_ID) | all | current] (PACKAGE),强制停止所有与包名相关的,--user (USER_ID) | all | current指定去强制停止的用户,如果没有指定则是所有用户。

  1. am force-stop com.jiongbull.art.note

    1
    root@shamu:/ # am force-stop com.jiongbull.art.note
  2. am force-stop —user current com.jiongbull.art.note

    1
    root@shamu:/ # am force-stop --user current com.jiongbull.art.note

am kill

am kill [--user (USER_ID) | all | current] (PACKAGE),杀死所有与包名相关的进程,仅杀死可以安全杀死的进程,也就是说不会对用户体验造成困扰,--user (USER_ID) | all | current指定哪个用户去杀死进程,如果没有指定则是所有用户。

  1. am kill com.jiongbull.art.note

    1
    root@shamu:/ # am kill com.jiongbull.art.note
  2. am kill —user current com.jiongbull.art.note

    1
    root@shamu:/ # am kill --user current com.jiongbull.art.note

am kill-all

杀死所有的后台进程。

am kill-all

1
root@shamu:/ # am kill-all

am broadcast

am broadcast [--user (USER_ID) | all | current] (INTENT),发送广播。

  • --user (USER_ID) | all | current 指定广播发送给哪个用户,如果没有指定则发送给所有人
  • --receiver-permission (PERMISSION) 要求Receiver需要的权限
  1. am broadcast -a android.intent.action.BOOT_COMPLETED

    1
    2
    3
    root@shamu:/ # am broadcast -a android.intent.action.BOOT_COMPLETED
    Broadcasting: Intent { act=android.intent.action.BOOT_COMPLETED }
    Broadcast completed: result=0
  2. am broadcast —user current -a android.intent.action.BOOT_COMPLETED

    1
    2
    3
    root@shamu:/ # am broadcast --user current -a android.intent.action.BOOT_COMPLETED
    Broadcasting: Intent { act=android.intent.action.BOOT_COMPLETED }
    Broadcast completed: result=0
  3. am broadcast —receiver-permission android.permission.RECEIVE_BOOT_COMPLETED -a android.intent.action.BOOT_COMPLETED

    1
    2
    3
    root@shamu:/ # am broadcast --receiver-permission android.permission.RECEIVE_BOOT_COMPLETED -a android.intent.action.BOOT_COMPLETED
    Broadcasting: Intent { act=android.intent.action.BOOT_COMPLETED }
    Broadcast completed: result=0

am instrument

1
2
3
am instrument [-r] [-e (NAME) (VALUE)] [-p (FILE)] [-w]
[--user (USER_ID) | current]
[--no-window-animation] [--abi (ABI)] (COMPONENT)

启动Instrumentation,通常目标组件是”测试包/运行类”这种格式的。

  • -r 输出原始结果(否则加密REPORT_KEY_STREAMRESULT),同时使用-e pref true可以输出性能测试的原始结果
  • -e (NAME) (VALUE) 把参数NAME的值设置为VALUE,对于测试运行器来说,最常见的表单格式是-e (testrunner_flag) (value)[,(value)...]
  • -p 配置数据输出到文件中
  • -w 等待instrumentation完成,需要测试运行器
  • --user (USER_ID) | current 指定哪个用户去运行instrumentation,如果没有指定则默认是当前用户
  • --no-window-animation 运行时关闭窗口动画
  • --abi (ABI) 使用指定的ABI启动instrumentation进程,这里假设进程指定指定的ABI
  1. am instrument -w com.jiongbull.art.note.test/android.support.test.runner.AndroidJUnitRunner

    1
    2
    3
    4
    5
    6
    root@shamu:/ # am instrument -w com.jiongbull.art.note.test/android.support.test.runner.AndroidJUnitRunner
    com.jiongbull.art.note.FirstActivityTest:....

    Time: 1.815

    OK (4 tests)
  2. am instrument -r -w com.jiongbull.art.note.test/android.support.test.runner.AndroidJUnitRunner

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    root@shamu:/ # am instrument -r -w com.jiongbull.art.note.test/android.support.test.runner.AndroidJUnitRunner
    INSTRUMENTATION_STATUS: numtests=4
    ...
    ...
    Time: 1.724

    OK (4 tests)


    INSTRUMENTATION_CODE: -1
  3. am instrument -e class com.jiongbull.art.note.FirstActivityTest -w com.jiongbull.art.note.test/android.support.test.runner.AndroidJUnitRunner

    1
    2
    3
    4
    5
    6
    7
    8
    9
    root@shamu:/ # am instrument -e class com.jiongbull.art.note.FirstActivityTest -w com.jiongbull.art.note.test/android.support.test.runner.AndroidJUnitRunner
    com.jiongbull.art.note.FirstActivityTest:....

    Time: 1.662

    OK (4 tests)


    INSTRUMENTATION_CODE: -1
  4. am instrument -r -e pref true -p /data/local/tmp/ins.trace -w com.jiongbull.art.note.test/android.support.test.runner.AndroidJUnitRunner

    1
    root@shamu:/ # am instrument -r -e pref true -p /data/local/tmp/ins.trace -w com.jiongbull.art.note.test/android.support.test.runner.AndroidJUnitRunner
  5. am instrument —user current -w com.jiongbull.art.note.test/android.support.test.runner.AndroidJUnitRunner

    1
    2
    3
    4
    5
    6
    root@shamu:/ # am instrument --user current -w com.jiongbull.art.note.test/android.support.test.runner.AndroidJUnitRunner
    com.jiongbull.art.note.FirstActivityTest:....

    Time: 2.221

    OK (4 tests)
  6. am instrument —no-window-animation -w com.jiongbull.art.note.test/android.support.test.runner.AndroidJUnitRunner

    1
    2
    3
    4
    5
    6
    root@shamu:/ # am instrument --no-window-animation -w com.jiongbull.art.note.test/android.support.test.runner.AndroidJUnitRunner
    com.jiongbull.art.note.FirstActivityTest:....

    Time: 1.842

    OK (4 tests)
  7. am instrument —abi x86_64 -w com.jiongbull.art.note.test/android.support.test.runner.AndroidJUnitRunner

    1
    2
    root@generic_x86_64:/ # am instrument --abi x86_64 -w com.jiongbull.art.note.test/android.support.test.runner.AndroidJUnitRunner
    com.jiongbull.art.note.FirstActivityTest:....

am profile start

am profile start [--user (USER_ID) | current] (PROCESS) (FILE),对进程开展分析,PROCESS可以是进程名或pid,当提供进程名称时,--user (USER_ID) | current用来指定哪个用户分析进程,如果没有指定则以是当前用户。

  1. am profile start com.tencent.mm /data/local/tmp/profile.txt

    1
    shell@shamu:/ $ am profile start com.tencent.mm /data/local/tmp/profile.txt
  2. am profile start —user current com.tencent.mm /data/local/tmp/profile.txt

    1
    shell@shamu:/ $ am profile start --user current com.tencent.mm /data/local/tmp/profile.txt

am profile stop

am profile stop [--user (USER_ID) | current] (PROCESS),停止对进程的分析,参数同am profile start

  1. am profile stop com.tencent.mm

    1
    shell@shamu:/ $ am profile stop com.tencent.mm
  2. am profile stop —user current com.tencent.mm

    1
    shell@shamu:/ $ am profile stop --user current com.tencent.mm

am dumpheap

am dumpheap [--user (USER_ID) current] [-n] (PROCESS) (FILE),把进程的堆内存信息输出到文件中,PROCESS可以是进程名或pid。

  • -n 输出本地堆而不是托管堆
  • --user (USER_ID) | current用来指定哪个用户输出进程信息,如果没有指定则以是当前用户。
  1. am dumpheap com.jiongbull.art.note /data/local/tmp/dump.txt

    1
    root@shamu:/ # am dumpheap com.jiongbull.art.note /data/local/tmp/dump.txt
  2. am dumpheap -n com.jiongbull.art.note /data/local/tmp/dump.txt

    1
    root@shamu:/ # am dumpheap -n com.jiongbull.art.note /data/local/tmp/dump.txt
  3. am dumpheap -user current com.jiongbull.art.note /data/local/tmp/dump.txt

    1
    root@shamu:/ # am dumpheap -user current com.jiongbull.art.note /data/local/tmp/dump.txt

am set-debug-app

am set-debug-app [-w] [--persistent] (PACKAGE),设置应用为调试状态。

  • -w 在应用启动后等待调试器
  • -persistent 保持调试状态
  1. am set-debug-app com.jiongbull.art.note

    1
    shell@shamu:/ $ am set-debug-app com.jiongbull.art.note
  2. am set-debug-app -w com.jiongbull.art.note

    1
    shell@shamu:/ $ am set-debug-app -w com.jiongbull.art.note
  3. am set-debug-app —persistent com.jiongbull.art.note

    1
    shell@shamu:/ $ am set-debug-app --persistent com.jiongbull.art.note

am clear-debug-app

am clear-debug-app清除先前设置的调试应用。

am sclear-debug-app

1
root@shamu:/ # am clear-debug-app

am bug-report

请求生成错误报告,完毕后会启动界面提示选择使用哪种方式传递报告。

am bug-report

1
2
root@shamu:/ # am bug-report
Your lovely bug report is being created; please be patient.

am monitor

am monitor [--gdb (port)],开始监控崩溃或ANR,--gbd,在指定端口开启gdbserv监控崩溃或ANR。

  1. am monitor

    1
    2
    3
    root@shamu:/ # am monitor
    Monitoring activity manager... available commands:
    (q)uit: finish monitoring
  2. am monitor —gdb 5439

    1
    2
    3
    root@shamu:/ # am monitor --gdb 5439
    Monitoring activity manager... available commands:
    (q)uit: finish monitoring

am hang

am hang [--allow-restart],挂起系统,--allow-restart允许看门狗执行正常的系统重启。

  1. am hang

    1
    2
    root@shamu:/ # am hang
    Hanging the system...
  2. am hang —allow-restart

    1
    2
    root@shamu:/ # am hang --allow-restart
    Hanging the system...

am restart

重启用户系统。

am restart

1
2
root@shamu:/ # am restart
Restart the system...

am idle-maintenance

立即执行闲置维护。

am idle-maintenance

1
2
root@shamu:/ # am idle-maintenance
Performing idle maintenance...

am screen-compat

am screen-compat [on|off] (PACKAGE),控制某个包的屏幕兼容性。

  1. am screen-compat on com.jiongbull.art.note

    1
    root@shamu:/ # am screen-compat on com.jiongbull.art.note
  2. am screen-compat off com.jiongbull.art.note

    1
    root@shamu:/ # am screen-compat off com.jiongbull.art.note

am to-uri

am to-uri [INTENT],以URI的格式输出指定intent的详情。

am to-uri -a android.intent.action.MAIN -c android.intent.category.LAUNCHER

1
2
root@shamu:/ # am to-uri -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;end

am to-intent-uri

am to-intent-uri [INTENT],以intent: URI的格式输出指定intent的详情。

am to-intent-uri -a android.intent.action.MAIN -c android.intent.category.LAUNCHER

1
2
root@shamu:/ # am to-intent-uri -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
intent:#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;end

am to-app-uri

am to-app-uri [INTENT],以android-app: URI的格式输出指定intent的详情。

am to-app-uri -p com.jiongbull.art.note

1
2
root@shamu:/ # am to-app-uri -p com.jiongbull.art.note
android-app://com.jiongbull.art.note

am switch-user

am switch-user <USER_ID>,在前台切换到指定标识的用户,如果该用户当前是停止状态就立即启动。

am switch-user 1

1
root@shamu:/ # am switch-user 1

am start-user

am start-user <USER_ID>,如果指定用户当前是停止状态就在后台启动,如果想在前台启动请使用am switch-user

am start-user 0

1
2
root@shamu:/ # am start-user 0
Success: user started

am stop-user

am stop-user <USER_ID>,停止指定标识的用户运行,不允许运行任何代码,除非显示启动它或切换到它。

am stop-user

1
root@shamu:/ # am stop-user 1

am stack start

am stack start <DISPLAY_ID> <INTENT>,使用intent在指定屏幕上启动新的activity。

am stack start 0 -n com.jiongbull.art.note/.chapter1.AActivity

1
2
root@shamu:/ # am stack start 0 -n com.jiongbull.art.note/.chapter1.AActivity
出错了,提示 Error: callback must not be null

am stack movetask

am stack movetask <TASK_ID> <STACK_ID> [true|false],把指定activity栈中指定的任务移动到顶部(true)或底部(false)。

am stack movetask 114 1 false

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
root@generic_x86_64:/ # am stack info 1
Stack id=1 bounds=[0,0][1080,1920] displayId=0
taskId=111: com.android.settings/com.android.settings.Settings
taskId=4: com.android.widgetpreview/com.android.widgetpreview.WidgetPreviewActivity
taskId=10: com.android.providers.downloads.ui/com.android.providers.downloads.ui.DownloadList
taskId=11: com.android.browser/com.android.browser.BrowserActivity
taskId=13: com.android.settings/com.android.settings.Settings$StorageUseActivity
taskId=17: com.android.camera/com.android.camera.Camera
taskId=104: com.jiongbull.art.note/com.jiongbull.art.note.app.UiTestActivity
taskId=110: com.google.android.gms/com.google.android.gms.app.settings.GoogleSettingsActivity
taskId=114: com.jiongbull.art.note/com.jiongbull.art.note.chapter1.AActivity

root@generic_x86_64:/ # am stack movetask 114 1 false
root@generic_x86_64:/ # am stack info 1
Stack id=1 bounds=[0,0][1080,1920] displayId=0
taskId=114: com.jiongbull.art.note/com.jiongbull.art.note.chapter1.AActivity
taskId=111: com.android.settings/com.android.settings.Settings
taskId=4: com.android.widgetpreview/com.android.widgetpreview.WidgetPreviewActivity
taskId=10: com.android.providers.downloads.ui/com.android.providers.downloads.ui.DownloadList
taskId=11: com.android.browser/com.android.browser.BrowserActivity
taskId=13: com.android.settings/com.android.settings.Settings$StorageUseActivity
taskId=17: com.android.camera/com.android.camera.Camera
taskId=104: com.jiongbull.art.note/com.jiongbull.art.note.app.UiTestActivity
taskId=110: com.google.android.gms/com.google.android.gms.app.settings.GoogleSettingsActivity

am stack resize

am stack resize <STACK_ID> <LEFT,TOP,RIGHT,BOTTOM>,改变栈的大小并移动位置。

am stack resize 1 1 1 1 1

1
root@generic_x86_64:/ # am stack resize 1 1 1 1 1

am stack list

显示所有activity栈和它们的大小。

am stack list

1
2
3
4
5
6
7
8
9
10
11
12
13
14
root@generic_x86_64:/ # am stack list
Stack id=1 bounds=[0,0][1080,1920] displayId=0
taskId=114: com.jiongbull.art.note/com.jiongbull.art.note.chapter1.AActivity
taskId=111: com.android.settings/com.android.settings.Settings
taskId=4: com.android.widgetpreview/com.android.widgetpreview.WidgetPreviewActivity
taskId=10: com.android.providers.downloads.ui/com.android.providers.downloads.ui.DownloadList
taskId=11: com.android.browser/com.android.browser.BrowserActivity
taskId=13: com.android.settings/com.android.settings.Settings$StorageUseActivity
taskId=17: com.android.camera/com.android.camera.Camera
taskId=104: com.jiongbull.art.note/com.jiongbull.art.note.app.UiTestActivity
taskId=110: com.google.android.gms/com.google.android.gms.app.settings.GoogleSettingsActivity

Stack id=0 bounds=[0,0][1080,1920] displayId=0
taskId=112: com.google.android.googlequicksearchbox/com.google.android.launcher.GEL

am stack info

显示指定activity栈的信息。

am stack info 1

1
2
3
4
5
6
7
8
9
10
11
root@generic_x86_64:/ # am stack info 1
Stack id=1 bounds=[0,0][1080,1920] displayId=0
taskId=111: com.android.settings/com.android.settings.Settings
taskId=4: com.android.widgetpreview/com.android.widgetpreview.WidgetPreviewActivity
taskId=10: com.android.providers.downloads.ui/com.android.providers.downloads.ui.DownloadList
taskId=11: com.android.browser/com.android.browser.BrowserActivity
taskId=13: com.android.settings/com.android.settings.Settings$StorageUseActivity
taskId=17: com.android.camera/com.android.camera.Camera
taskId=104: com.jiongbull.art.note/com.jiongbull.art.note.app.UiTestActivity
taskId=110: com.google.android.gms/com.google.android.gms.app.settings.GoogleSettingsActivity
taskId=114: com.jiongbull.art.note/com.jiongbull.art.note.chapter1.AActivity

am lock-task

am lock-task <TASK_ID>,固定屏幕,把指定任务栈移到前台并禁止其他任务栈运行。

an lock-task 114

1
2
root@generic_x86_64:/ # am lock-task 114
Activity manager is in lockTaskMode

am lock-task stop

停止固定屏幕。

am lock-task stop

1
root@generic_x86_64:/ # am lock-task stop

am get-config

检索配置和设备上的最近配置。

am get-config

1
2
3
4
5
6
7
8
config: mcc310-mnc260-zh-rCN-sw360dp-w360dp-h567dp-normal-notlong-port-notnight-xxhdpi-finger-keysexposed-nokeys-navhidden-nonav-v22
abi: x86_64,x86
recentConfigs:
config: mcc310-mnc260-zh-rCN-sw360dp-w360dp-h567dp-normal-notlong-port-notnight-xxhdpi-finger-keysexposed-nokeys-navhidden-nonav-v22
config: zh-rCN-sw360dp-w360dp-h567dp-normal-notlong-port-xxhdpi-finger-keysexposed-nokeys-navhidden-nonav-v22
config: zh-rCN-sw360dp-w360dp-h567dp-normal-notlong-port-notnight-xxhdpi-finger-keysexposed-nokeys-navhidden-nonav-v22
config: zh-rCN-sw360dp-w360dp-h640dp-normal-long-port-xxhdpi-notouch-keysexposed-nokeys-navhidden-nonav-v22
config: zh-rCN-sw360dp-w360dp-h567dp-normal-notlong-port-xxhdpi-notouch-keysexposed-nokeys-navhidden-nonav-v22

intent

指定intent时用到的标识和参数。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>]
[-c <CATEGORY> [-c <CATEGORY>] ...]
[-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...]
[--esn <EXTRA_KEY> ...]
[--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...]
[--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]
[--el <EXTRA_KEY> <EXTRA_LONG_VALUE> ...]
[--ef <EXTRA_KEY> <EXTRA_FLOAT_VALUE> ...]
[--eu <EXTRA_KEY> <EXTRA_URI_VALUE> ...]
[--ecn <EXTRA_KEY> <EXTRA_COMPONENT_NAME_VALUE>]
[--eia <EXTRA_KEY> <EXTRA_INT_VALUE>[,<EXTRA_INT_VALUE...]]
[--ela <EXTRA_KEY> <EXTRA_LONG_VALUE>[,<EXTRA_LONG_VALUE...]]
[--efa <EXTRA_KEY> <EXTRA_FLOAT_VALUE>[,<EXTRA_FLOAT_VALUE...]]
[--esa <EXTRA_KEY> <EXTRA_STRING_VALUE>[,<EXTRA_STRING_VALUE...]]
(to embed a comma into a string escape it using "\,")
[-n <COMPONENT>] [-p <PACKAGE>] [-f <FLAGS>]
[--grant-read-uri-permission] [--grant-write-uri-permission]
[--grant-persistable-uri-permission] [--grant-prefix-uri-permission]
[--debug-log-resolution] [--exclude-stopped-packages]
[--include-stopped-packages]
[--activity-brought-to-front] [--activity-clear-top]
[--activity-clear-when-task-reset] [--activity-exclude-from-recents]
[--activity-launched-from-history] [--activity-multiple-task]
[--activity-no-animation] [--activity-no-history]
[--activity-no-user-action] [--activity-previous-is-top]
[--activity-reorder-to-front] [--activity-reset-task-if-needed]
[--activity-single-top] [--activity-clear-task]
[--activity-task-on-home]
[--receiver-registered-only] [--receiver-replace-pending]
[--selector]
[<URI> | <PACKAGE> | <COMPONENT>]

分享与支持

  • 如果这篇文章对你有帮助,请分享下面的链接让更多人受益。
  • 更多支持,请点这里
文章目录
  1. 1. am start
  2. 2. am startservice
  3. 3. am stopservice
  4. 4. am force-stop
  5. 5. am kill
  6. 6. am kill-all
  7. 7. am broadcast
  8. 8. am instrument
  9. 9. am profile start
  10. 10. am profile stop
  11. 11. am dumpheap
  12. 12. am set-debug-app
  13. 13. am clear-debug-app
  14. 14. am bug-report
  15. 15. am monitor
  16. 16. am hang
  17. 17. am restart
  18. 18. am idle-maintenance
  19. 19. am screen-compat
  20. 20. am to-uri
  21. 21. am to-intent-uri
  22. 22. am to-app-uri
  23. 23. am switch-user
  24. 24. am start-user
  25. 25. am stop-user
  26. 26. am stack start
  27. 27. am stack movetask
  28. 28. am stack resize
  29. 29. am stack list
  30. 30. am stack info
  31. 31. am lock-task
  32. 32. am lock-task stop
  33. 33. am get-config
  34. 34. intent
  35. 35. 分享与支持