ADB命令
来源:互联网 发布:淘宝商家营销手段 编辑:程序博客网 时间:2024/06/08 09:42
常用adb操作
恢复出厂设置
adb shell am broadcast -a android.intent.action.MASTER_CLEAR
卡刷升级
adb shell am broadcast -a android.intent.action.ONEKEY_UPGRADE
解锁
adb shell input keyevent 82
唤醒/休眠
adb shell input keyevent 26
输入文字
adb shell input text 10086
查看当前activity
adb shell dumpsys activity | grep mF
打开wifi
adb shell svc wifi enable
查看usb mode
adb shell svc usb getFunction
开启唤醒锁
adb shell echo 1 >/sys/power/wakelock
关闭唤醒锁
adb shell echo 1 >/sys/power/wakeunlock
设置时间
adb shell date -s +%c 061315232016.12
打开Activity
adb shell am start -n com.android.settings/.Settings\$AdvancedWifiSettingsActivity
发送短信
adb shell am start -a android.intent.action.SENDTO -d sms:10086 --es sms_body 123 --ez exit_on_sent true
打开wifi firmware log
wifi on状态下 dhdutil -i wlan0 dconpoll 10
常用一键操作
一键升级步骤
- adb remount
- adb push update.zip /cache 拷贝升级包
- adb shell am broadcast -a android.intent.action.ONEKEY_UPGRADE
- adb shell am broadcast -a android.intent.action.MASTER_CLEAR
Kill Monkey (Linux终端下)
adb shell kill “$(adb shell ps | grep monkey | awk '{print $2}')”
adb shell 下
kill “$(ps | grep monkey | tr -s [:space:] | cut -d ' ' -f 2)”
Kill Monkey (Uiautomator脚本)
adb shell uiautomator runtest test.jar -c com.sqa.Operate#killMonkey
Kill Uiautomator(Linux终端下)
adb shell kill “$(adb shell ps | grep uiautomator | awk '{print $2}')”
设置系统时间
echo 20160614150102 > /sys/class/rtc/rtc0/setrtc
确认Camera前后正常打开
1.adb shell am start -n com.android.camera2/com.android.camera.CameraLaun
Monkey测试步骤
- 一键升级
- 确认版本号 getDevicesInfo.sh
- 设置系统时间 setTime.sh (push.sh)
- 确认camera前后正常打开 checkCamera.sh
- 连接WIFI connectWIFI.sh
开启wifi日志
a.netcfg wlan0 up
b.dhdutil -i wlan0 dconpoll 10
c.netcfg wlan0 down - 开启CPlog setCPSilentlog.sh
- 重启
- 开始测试
开关机测试
- adb install AutoOnOff.apk
- adb shell am start -n com.android.settings/.Settings\$SecuritySettingsActivity
- adb shell uiautomator runtest test.jar -c com.sqa.Operate#clickText -e 1 Screen_lock -e 2 None
- adb shell am start -n com.sqa.autoonoff/.MainActivity
- adb shell uiautomator runtest test.jar -c com.sqa.Operate#clickText -e 1 Run
- 拔掉USB线
- adb 命令
- adb 命令
- adb命令
- adb命令
- adb 命令
- adb 命令
- adb 命令
- adb命令
- adb命令
- adb命令
- ADB 命令
- adb命令
- adb 命令
- adb命令
- adb 命令
- adb命令
- adb命令
- adb命令
- python-Xgboost可视化问题 You must install graphviz to plot tree
- [51nod1325]两棵树的问题
- A【1-1-12】C语言运算符优先级与结合方向
- 第15周项目1 -3 验证算法之希尔排序
- 概率相关的证明
- ADB命令
- 第16周实践项目三——点结构体(1)
- 用matlab弹奏卡农
- github项目之仿小猪巴士车牌显示
- java 强弱软虚 四种引用,以及用到的场景。
- 【office】将office2016安装到指定目录上
- A【1-1-13】练习题
- 第15周项目2 用哈希法组织关键字
- Maven Repository中添加自定义的jar包