adb命令
来源:互联网 发布:sql select as 编辑:程序博客网 时间:2024/05/21 08:40
第一篇:adb shell am 的用法(转子:http://blog.csdn.net/fulinwsuafcie/article/details/8092459)
adb shell am 的功能
adb shell am
使用此命令可以从cmd控制台启动 activity, services;发送 broadcast等等:
C:\Users\Administrator>adb shell am
usage: am [subcommand] [options]
start an Activity: am start [-D] [-W] <INTENT>
-D: enable debugging
-W: wait for launch to complete
start a Service: am startservice <INTENT>
send a broadcast Intent: am broadcast <INTENT>
start an Instrumentation: am instrument [flags] <COMPONENT>
-r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT)
-e <NAME> <VALUE>: set argument <NAME> to <VALUE>
-p <FILE>: write profiling data to <FILE>
-w: wait for instrumentation to finish before returning
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
<INTENT> specifications include these flags:
[-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> ...]
[-e|--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]
[-n <COMPONENT>] [-f <FLAGS>]
[--grant-read-uri-permission] [--grant-write-uri-permission]
[--debug-log-resolution]
[--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]
[--receiver-registered-only] [--receiver-replace-pending]
[<URI>]
usage: am [subcommand] [options]
start an Activity: am start [-D] [-W] <INTENT>
-D: enable debugging
-W: wait for launch to complete
start a Service: am startservice <INTENT>
send a broadcast Intent: am broadcast <INTENT>
start an Instrumentation: am instrument [flags] <COMPONENT>
-r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT)
-e <NAME> <VALUE>: set argument <NAME> to <VALUE>
-p <FILE>: write profiling data to <FILE>
-w: wait for instrumentation to finish before returning
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
<INTENT> specifications include these flags:
[-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> ...]
[-e|--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]
[-n <COMPONENT>] [-f <FLAGS>]
[--grant-read-uri-permission] [--grant-write-uri-permission]
[--debug-log-resolution]
[--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]
[--receiver-registered-only] [--receiver-replace-pending]
[<URI>]
使用实例:
如启动一个 Activity:
格式:
adb shell am start -n 包名/包名+类名(-n 类名,-a action,-d date,-m MIME-TYPE,-c category,-e 扩展数据,等)。
实例1:
C:\Users\Administrator>adb shell am start -n com.android.camera/.Camera
Starting: Intent { cmp=com.android.camera/.Camera }
Starting: Intent { cmp=com.android.camera/.Camera (has extras) }
Starting: Intent { cmp=com.android.camera/.Camera }
实例2:(带extra 的 intent)
C:\Users\Administrator>adb shell am start -n com.android.camera/.Camera -e abc helloStarting: Intent { cmp=com.android.camera/.Camera (has extras) }
其中 extra 的 key 为 abc ,value 为字串 "hello"
第二篇: adb shell pm 命令(转自:http://blog.sina.com.cn/s/blog_4e9b076e01016d8a.html)
adb shell pm 命令详细
usage: pm list packages [-f] [-d] [-e] [-s] [-3] [-i] [-u] [FILTER]
pm list packages: prints all packages, optionally only
pm list permission-groups: prints all known permission groups.
pm list permissions: prints all known permissions, optionally only
pm list instrumentation: use to list all test packages; optionally
pm list features: prints all features of the system.
pm path: print the path to the .apk of the given PACKAGE.
pm install: installs a package to the system. Options:
pm uninstall: removes a package from the system. Options:
pm clear: deletes all data associated with a package.
pm enable, disable, disable-user: these commands change the enabled state
pm grant, revoke: these commands either grant or revoke permissions
pm get-install-location: returns the current install location.
pm set-install-location: changes the default install location.
第四篇:http://changxianli6121.blog.163.com/blog/static/56392130201322805518442/
第五篇:adb logcat 基本用法:http://blog.csdn.net/fulinwsuafcie/article/details/8028572
0 0
- adb 命令
- adb 命令
- adb命令
- adb命令
- adb 命令
- adb 命令
- adb 命令
- adb命令
- adb命令
- adb命令
- ADB 命令
- adb命令
- adb 命令
- adb命令
- adb 命令
- adb命令
- adb命令
- adb命令
- 斯坦福机器学习-week5 学习笔记(1)——神经网络训练BP算法与Gradient checking
- Android使用https链接
- SQL技巧--------查询重复
- opencv 实践程序2——背景差分法实现前景识别
- 来自苹果、谷歌、微软等知名公司六道有趣智力面试题,试试吧!
- adb命令
- Flex 4.1 + BlazeDs + parsley框架(Demo实例)
- cocos2d-x 3.0开发笔记---物理引擎封装 Physics深入学习
- Windows无线Wifi(网络承载实现)
- QThread中的slots在那个线程中执行?
- cocos2d-x-3.0 的 lua 可以跑在 mac 上面, 2.2 版本不行
- 手把手教你做iphone的soap应用(webservice)
- Python challenge_11
- eclipse启动时问题集锦