- 论坛徽章:
- 0
|
我们都知道用"adb install filename.apk"命令可以安装一个android程序,那你知道在安装后如何启动你的程序吗?
试试下面的命令吧。
01.adb shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n breakan.test/breakan.test.TestActivity
复制代码或简单一些。
01.adb shell am start -n breakan.test/breakan.test.TestActivity
复制代码其中"breakan.test/breakan.test.TestActivity"中的"breakan.test"是程序的包名,"TestActivity"是程序Activity类的类名。我们来看下adb shell am命令的帮助。
01.usage: am [subcommand] [options]
02.
03. start an Activity: am start [-D] [-W] <INTENT>
04. -D: enable debugging
05. -W: wait for launch to complete
06.
07. start a Service: am startservice <INTENT>
08.
09. send a broadcast Intent: am broadcast <INTENT>
10.
11. start an Instrumentation: am instrument [flags] <COMPONENT>
12. -r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT)
13. -e <NAME> <VALUE>: set argument <NAME> to <VALUE>
14. -p <FILE>: write profiling data to <FILE>
15. -w: wait for instrumentation to finish before returning
16.
17. start profiling: am profile <PROCESS> start <FILE>
18. stop profiling: am profile <PROCESS> stop
19.
20. <INTENT> specifications include these flags:
21. [-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>]
22. [-c <CATEGORY> [-c <CATEGORY>] ...]
23. [-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...]
24. [--esn <EXTRA_KEY> ...]
25. [--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...]
26. [-e|--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]
27. [-n <COMPONENT>] [-f <FLAGS>]
28. [--grant-read-uri-permission] [--grant-write-uri-permission]
29. [--debug-log-resolution]
30. [--activity-brought-to-front] [--activity-clear-top]
31. [--activity-clear-when-task-reset] [--activity-exclude-from-recents]
32. [--activity-launched-from-history] [--activity-multiple-task]
33. [--activity-no-animation] [--activity-no-history]
34. [--activity-no-user-action] [--activity-previous-is-top]
35. [--activity-reorder-to-front] [--activity-reset-task-if-needed]
36. [--activity-single-top]
37. [--receiver-registered-only] [--receiver-replace-pending]
38. [<URI>]
复制代码 |
|