您的位置:首页 > 其它

ADB命令

2016-12-15 12:25 92 查看


常用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线
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: