티스토리 뷰

지식쌓기

Android - adb start activity

바나나쥬스 2014. 7. 16. 16:14

am start 쓰면됨..


adb shell am start -a (action) -d (data uri) -t (mimetype) -n (component : packagename/activity)

ex) adb shell am start -a android.intent.action.VIEW -d http://www.google.com


usage: am start [-D] [-W] [-P <FILE>] [--start-profiler <FILE>]

               [--R COUNT] [-S] [--opengl-trace]

               [--user <USER_ID> | current] <INTENT>


am start: start an Activity.  Options are:

    -D: enable debugging

    -W: wait for launch to complete

    --start-profiler <FILE>: start profiler and send results to <FILE>

    -P <FILE>: like above, but profiling stops when app goes idle

    -R: repeat the activity launch <COUNT> times.  Prior to each repeat,

        the top activity will be finished.

    -S: force stop the target app before starting the activity

    --opengl-trace: enable tracing of OpenGL functions

    --user <USER_ID> | current: Specify which user to run as; if not

        specified then run as the current user.


<INTENT> specifications include these flags and arguments:

    [-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...]]

    [-n <COMPONENT>] [-f <FLAGS>]

    [--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]

    [<URI> | <PACKAGE> | <COMPONENT>]