ADB命令合集
转载:http://blog.csdn.net/u013254166/article/details/79290792
本文出自: 【rhino博客】
- 日志相关
打印log
adb logcat 或 adb shell logcat
将log重定向到log.txt
adb locat > ./log.txt
将log重定向到log.txt,并在控制台输出
adb logcat |tee ./log.txt
过滤main log
adb logcat -b main
过滤events log
adb logcat -b events
过滤radio log
adb logcat -b radio
过滤system log(SLOG)
adb logcat -b system
过滤某个TAG的log
adb logcat -s “TAG”
过滤error log
adb logcat *:e
过滤warn log
adb logcat *:w
打印TAG为MountService和Vold的Info以上级别的log
adb logcat MountService:I Vold:I *:S
显示日期,调用时间,优先级/标记,PID
adb logcat -v time
仅显示进程:线程和优先级/标记
adb logcat -v thread
清除log缓存
adb logcat -c
- 查看手机信息
查询系统内存信息
adb shell cat /proc/meminfo
查询系统cpuinfo
adb shell cat /proc/cpuinfo
查询系统属性
adb shell getprop
过滤ro.product.board属性
adb shell getprop |grep ro.product.board
查看mac地址
adb shell cat /sys/class/net/wlan0/address
查看手机ip
adb shell netcfg
查看手机分辨率
adb shell dumpsys window displays
查看手机分辨率
adb shell wm size
重启手机
adb reboot
重启到刷机模式
adb reboot bootloader
重启到recovery,即恢复模式
adb reboot recovery
app相关操作
列出手机上的所有包
adb shell pm list packages
清除程序数据
adb shell pm clear xxx(包名)
获取应用程序安装位置
adb shell pm get-install-location
设置应用程序安装位置为外置([0/auto] [1/internal] [2/external])
adb shell pm set-install-location 2
保留数据卸载程序
adb shell pm uninstall [-k] xxx(包名)
禁言程序
adb shell pm disable xxx(包名)
启用程序
adb shell pm enable xxx(包名)
打开app指定activity
adb shell am start -n “com.rhino.mr/com.rhino.mr.MainActivity” -a android.intent.action.MAIN –es num 8
- 录制手机屏幕
录制手机屏幕存放到手机sd卡里,默认录制时间为180s。按Ctrl+C结束录制。
adb shell screenrecord /sdcard/demo.mp4
限制视频录制时间为10s
adb shell screenrecord –time-limit 10 /sdcard/demo.mp4