(原创不易,你们对阿超的赞就是阿超持续更新的动力!)
(以免丢失,建议收藏,阿超持续更新中…)
-----------------------------------------------------------------------
安装应用命令
adb install xxx.apk
adb install -r xxx.apk 覆盖安装
adb install -l 锁定该应用程序
adb install -t 允许测试包
adb install -s 把应用程序安装到sd卡上
adb install -d 允许降级安装
adb install -g 为应用程序授予所有运行时的权限
卸载应用命令
adb uninstall 包名
启用应用命令
pm enable 包名
停用应用命令
pm disable 包名
退出adb调试
exit
停止应用程序的进程
am force-stop 包名
抓取网页信息(常用来测手机网络状态)
curl 域名
清除应用数据命令
adb shell pm clear 包名
给应用授权
pm grant 包名 相关权限(android.permission.READ_PHONE_STATE)
刷机命令
adb reboot recovery
向手机文本框输入文本内容
adb shell input text 内容
手机返回上一级命令
adb shell input keyevent 4
拉取手机中的文件到电脑
拿到全路径之后
adb pull 文件路径 电脑路径
电脑往手机传文件
adb push 文件 手机路径
查看手机安装的所有app包名
adb shell pm list packages
查看手机中所有应用的路径及包名
adb shell pm list packages -f
adb启动某个应用
adb shell am start 包名/完整Activity路径
获取应用包名以及主Activity路径
打开需要获取包名和主activity的APP
adb shell dumpsys window | findstr mCurrentFocus
屏幕截图
adb shell screencap /需要存放的路径/
解锁屏幕
adb shell input keyevent 82
在屏幕上做划屏操作
adb shell input swipe 50 250 250 250 500
在屏幕上点击坐标点位置
adb shell input tap 50 250
查看手机分辨率
adb shell wm size
查看屏幕密度
adb shell wm density
查看当前连接设备
adb devices
查看日志
adb logcat
查看Android版本
adb shell getprop ro.build.version.release
在当前目录下的文件中查找指定字符
grep -n '张三' xxx.txt
在当前目录下的文件中过滤指定内容
grep -P '^([0-9]{3}-|\([0-9]{3}\) ) [0-9]{3}-[0-9]{4}$' file.txt
查看文件的第十行数据
sed -n '10p' xxx.txt
查看文件的第三行到第六行数据
sed -n '3,6p' xxx.txt
使用release包查看打印日志
adb shell setprop log.tag.TAG V
(TAG为打印日志设置的TAG名称)
由下至上滑动
input swipe 500 1500 500 500
由上至下滑动
input swipe 500 500 500 1500
由右至左滑动
input swipe 900 1500 200 1500
由左至右滑动
input swipe 200 1500 900 1500