Android am start 参数详解

am命令有很多个参数及使用方法,具体可参考官方网站:Android Debug Bridge

am的用法列表如下:

usage: am start [-D] [-W] [-P ] [--start-profiler ]
               [--R COUNT] [-S] [--opengl-trace]
               [--user  | current] 
       am startservice [--user  | current] 
       am force-stop [--user  | all | current] 
       am kill [--user  | all | current] 
       am kill-all
       am broadcast [--user  | all | current] 
       am instrument [-r] [-e  ] [-p ] [-w]
               [--user  | current]
               [--no-window-animation] 
       am profile start [--user  current]  
       am profile stop [--user  current] []
       am dumpheap [--user  current] [-n]  
       am set-debug-app [-w] [--persistent] 
       am clear-debug-app
       am monitor [--gdb ]
       am screen-compat [on|off] 
       am display-size [reset|WxH]
       am display-density [reset|DENSITY]
       am to-uri [INTENT]
       am to-intent-uri [INTENT]
       am switch-user 
       am stop-user 

下面只介绍am start 的用法

各条命令参数如下所示:

 specifications include these flags and arguments:
    [-a ] [-d ] [-t ]
    [-c  [-c ] ...]
    [-e|--es   ...]
    [--esn  ...]
    [--ez   ...]
    [--ei   ...]
    [--el   ...]
    [--ef   ...]
    [--eu   ...]
    [--ecn  ]
    [--eia  [, [, [,] [-f ]
    [--grant-read-uri-permission] [--grant-write-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]
    [ |  | ]

具体如何使用,还可以参考Android源代码,am.java文件

------------------------------------------2014.11.20  更新-------------------------

am broadcast -a com.android.captureCamera.CaptureCameraService
启动nubia手机的抓拍功能




你可能感兴趣的:(Android测试)