adb脚本选择语句_ADB脚本

承接上文啦!!!

adb devices

打印所有链接的模拟器或者设备

adb forward

建立本机端口8000 转发到模拟器或者设备的9000端口

adb kill-servser<===>adb start-server

关闭adb服务<====>开启adb服务

adb connect

通过WiFi链接

1.首先先通过USB链接

2.然后使用adb devices 查看设备

3.adb tcpip 5555 重启TCP端口:5555

4.通过手机查看手机的ip地址并记录

5.adb connect ip:5555

6.拔掉USB线,你仍然可以访问到设备此时adb devices 查看的时候会显示ip

adb usb

以USB模式重启adb

adb install [option]

adb install test.apk

adb install -l test.apk 锁定应用

adb install -r test.apk 替换现有的应用

adb install -t test.apk 允许测试包

adb install -s test.apk 安装在sd卡上

adb install -d test.apk 版本降级

adb install -p test.apk 部分应用安装

adb uninstall [options]

adb uninstall com.test.app

adb uninstall -k com.test.app 删除应用后保留数据

adb shell pm list package [options]

adb shell pm list packages

adb shell pm list packages -f 查看相关文件

adb shell pm list packages -d 显示被禁用的包

adb shell pm list packages -e 显示已启用的包

adb shell pm list packages -s 显示系统包

adb shell pm list packages -3 显示第三方包

adb shell pm list packages -i 显示已安装的包

adb shell pm list packages -u 也显示卸载的包

adb shell pm list packages —user 用户空间

adb shell pm path

adb shell pm path com.android.phone

adb shell pm clear

adb shell pm clear com.test.abc 清楚应用数据、缓存

adb pull [local]

adb pull /sdcard/demo.mp4 下载/sdcard/demo.mp4到/platform-tools目录中

adb pull /sdcard/demo.mp4 e:\ 下载/sdcard/demo.mp4到e盘

adb push [remote]

adb push test.apk /sdcard 将platform-tools/test.apk 复制到/sdcard

adb push d:\test.apk /sdcard

adb shell ls

1.adb shell

2.ls

ls -a

ls -i

ls -s

ls -n

ls -R

adb shell cd

adb shell rm

adb shell rm -f

adb shell rm -r

adb shell rm -d

adb shell rm -i

adb shell mkdir

mkdir -m 777 /sdcard/tmp 设置权限

mkdir -p /sdcard/tmp 根据需要创建

adb shell touch

touch /sdcard/tmp/test.txt 可以显示 ls /sdcard/tmp

adb shell pwd 显示当前位置

adb shell cp

cp /sdcard/test.txt /sdcard/demo.txt 复制

adb shell mv

mv /sdcard/tmp /system/tmp 移动

mv /sdcard/tmp /sdcard/test 重命名

adb shell netstat 网络统计

adb shell ping www.baidu.com

adb shell netcfg 网络配置和管理

adb shell ip

ip -f inet addr show waln0 显示WiFi-IP地址

adb logcat

adb logcat *:V 最低优先级只显示详细信息

adb logcat *:D 只显示调试信息

adb logcat *:I 只显示信息

adb logcat *:W 只显示警告信息

adb logcat *:E 只显示错误信息

adb logcat *:F 只显示致命信息

adb logcat *:S 最高级别

adb logcat -b radio 查看无线电或者电话相关的消息缓冲区

adb logcat -b event 查看事件相关缓冲区

adb logcat -b main 默认

adb logcat -c 清除整个缓冲区并退出

adb logcat -d 打印日志并退出

adb logcat -f test.logs 将日志信息写入test

adb logcat -g 打印日志缓冲区并退出

adb logcat -n 设置日志数量

adb logcat -r 按字节数输出日志

adb logcat -s 设置默认

adb logcat -v brief 显示优先级和PID

adb logcat -v process 显示PID

adb logcat -v tag 显示优先级

adb logcat -v raw 只显示原始日志信息

adb logcat -v time 显示日期、时间、优先级、PID

adb logcat -v threadtime 显示日期、时间、优先级、PID、TID

adb logcat -v long 显示所有字段并用空格分隔

adb shell dumpsys

dumps system data

adb shell dumpsys battery 注:安卓5.0

adb shell dumpsys batterystats 收集电池数据

adb shell dumpsys batterystats —reset 擦出就数据

adb shell dumpsys activity

adb shell dumpsys gfxinfo com.android.phone measuring com.android.phone ui performance

adb shell dumpstate

adb shell dumpstate > state.logs 保存存储状态到文件

adb shell screencap

adb shell screencap /sdcard/screen.png

adb pull /sdcard/screen.png

adb shell screenrecord 安卓4.4

adb shell screenrecord /sdcard/demp.mp4

adb pull /sdcard/demo.mp4

adb shell screenrecord —size 控制视频尺寸

adb shell screenrecord —bit-rate 设置视频比特率

adb shell screenrecord —time-limit 单位:秒 设置视频时间 默认为180秒

adb shell screenrecord —rotate 旋转90度

adb shell screenrecord —verbose 在屏幕上显示日志和命令行

adb root 以root用户身份运行

adb sideload

adb shell ps

ps -p

adb shell top 显示CPU的进程

top -t 显示线程代替进程

adb shell getprop

adb shell set prop

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值