【问题标题】:Unlock android mobile with PIN code programmatically Selenium mobile automation以编程方式使用 PIN 码解锁 android 手机 Selenium 移动自动化
【发布时间】:2017-03-01 22:05:33
【问题描述】:
我有一个任务,我需要使用 Java 中的 Appium 和 selenium 编写 Android 移动测试自动化。我必须使用 PINCODE 编程方式解锁手机。
有没有办法在自动化测试中使用 pincode 解锁 android 手机?谁能给我任何建议来完成这项任务。
【问题讨论】:
标签:
android
selenium
automation
appium
【解决方案1】:
虽然 appium 可以唤醒我们的设备,但 Appium 没有解锁图案/密码锁的功能。要锁定/解锁屏幕,我们需要使用 ADB 命令,以下是一些您可以尝试的示例:
从睡眠模式唤醒设备
adb shell input keyevent KEYCODE_POWER
向上滑动以获取 PIN 屏幕
adb shell input swipe 800 400 400 400
输入密码
adb shell input text 0000
点击回车解锁
adb shell input keyevent KEYCODE_ENTER