adb常用指令

1、adb devices 获取模拟器或物理手机设备

2、adb install 安装软件
adb -s emulator-5554 install E:\CalculatorOfTwoNum.apk 连接了多个设备
adb install -r E:\CalculatorOfTwoNum.apk 覆盖安装已有的软件
adb install E:\CalculatorOfTwoNum.apk只有一个设备且未安装

3、adb uninstall 卸载软件
adb -s emulator-5554 uninstall com.example.calculatoroftwonum 卸载指定设备的软件
adb -s emulator-5554 shell pm uninstall -k com.example.calculatoroftwonum 保留配置及缓存

4、adb pull 把文件从手机设备发送到本地计算机
adb pull /sdcard/tmp/error.data d:/
adb -s emulator-5554 pull /sdcard/tmp/error.data d:/ 连接了多个设备个

5、adb push 把文件从本地计算机发送到手机设备
adb -s emulator-5554 push d:/example/error.data /sdcard/pass

6、adb shell ls 显示当前目录的所有内容

7、adb shell 查看手机安装的应用
su root
cd /data/data
ls

8、adb shell dumpsys battery 查看电量信息

9、adb shell dumpsys wifi 查看无线网络信息

10、adb shell dumpsys power 查看电源信息

11、adb shell dumpsys telephony.registry 查看电话相关信息

12、adb shell cat /proc/cpuinfo 查看CPU硬件信息

13、adb shell cat /proc/meminfo 查看内存信息

14、adb shell cat /proc/iomen 查看I/O内存分区的信息

15、adb shell cat /system/build.prop | findstr "ro.product.model" 获取手机型号

16、adb shell cat /proc/cpuinfo | findstr "Processor" 获取手机处理器信息

17、adb shell cat /proc/meminfo | findstr "MemTotal" 获取手机内存信息

18、adb shell dumpsys windows | findstr "Display" 获取手机屏幕分辨率信息

19、adb shell getprop ro.build.version.release 获取系统版本信息

20、adb shell cat /proc/version 获取内核版本信息

21、adb shell getprop gsm.operator.alpah 获取运营商信息

22、adb shell getprop gsm.network.type 获取网络类型信息

23、adb shell dumpsys iphonesubinfo | findstr "Devices ID" 获取手机串号信息

24、adb shell df 获取系统分区信息

25、adb shell dmesg 获取linux内核环形缓冲区信息

26、adb shell dumpstate 获取系统当前状态

27、adb get-serialno 获取设备序列号

28、adb get-state 获取设备当前状态

29、adb logcat 查看日志信息
adb logcat *:W 输出优先级大于警告级的信息
adb logcat -b main 查看主缓冲区信息

30、adb bugreport 查看启动过程日志

31、adb jdwp 列出指定设备的IDWP相关进程的ID

32、adb start-server 启动adb服务

33、adb kill-server 关闭adb服务

34、adb forward 将本机的端口重定向到模拟器或者设备端口上
adb forward tcp:2211 tcp:5566

35、am 模拟系统行为
adb shell am start -n com.sec.android.app.camera/.Camera 启动照相功能
adb shell am broadcast -a android.intent.action.BATTERY_CHANGED --ei "level"5 --ei "scale" 100 向手机发送模拟手机低电环境的信息

36、pm 模拟行为或者查询设备上的应用
adb shell pm list packages

37、向模拟器发送短信、打电话


20181021141213.png

20181021141252.png

cmd telnet localhost 5554


20181021141306.png

gsm call <phone> 模拟来电
sms <phone> hi,tester 模拟来信
network status 查看网络状态

network speed 14.4:20 设定网速
network delay 5 设定网络延时5毫秒
network capture start/stop 开始/停止数据包的捕获
windows scale 0.5 修改模拟器大小比例
quit退出

39、android list targets 查看模拟器的Android系统版本

40、android create avd 创建模拟器
android create avd --name Android4.4.2 --target 2 --abi armeabi-v7a

41、android move avd -n Android4.4.2 -r mytestdev4.4.2 重命名模拟器

42、android list avd 查看模拟器列表

43、android delete avd -n hhh 删除模拟器

44、emulator -avd Android4.4.2 启动模拟器

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容