使用monkeyrunner解锁设备(图案)
抱歉,如果我确实问了一个之前已经问过的问题。我在这个论坛和谷歌上搜索了很多,但找不到答案。
我对 Monkeyrunner 非常陌生,并试图解决自动注销受模式保护的 USB 设备的问题。
是否可以添加两个不同方向的拖动功能? A到B到C?一个图案通常至少需要 4 个点,这使得拖动有两个方向。 我编写了这个脚本,它可以很好地观察屏幕,但它会在手机不接受的情况下中断:
print ("Unlocking screen.")
device.wake()
device.touch(400, 314, MonkeyDevice.DOWN)
device.drag((400, 314),(80, 635), 1,3)
device.drag((80, 635),(400, 635), 1,3)
device.touch(400, 635, MonkeyDevice.UP)
我希望有人能够提供帮助。谢谢!
Sorry if I do ask a question which has been asked before. I was searching a lot in this forum and via Google but couldn't find an answer.
I'm very new to Monkeyrunner and trying to solve the problem to automatically unlog my USB device which is secured with a pattern.
Is it possible to add a drag functionality with 2 different directions? A to B to C? A pattern usually needs at least 4 dots, which makes two directions for dragging.
I wrote this script which works fine observing the screen, but it interrupts in between which is not accepted by the phone:
print ("Unlocking screen.")
device.wake()
device.touch(400, 314, MonkeyDevice.DOWN)
device.drag((400, 314),(80, 635), 1,3)
device.drag((80, 635),(400, 635), 1,3)
device.touch(400, 635, MonkeyDevice.UP)
I hope someone is able to help. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚发表了一篇关于使用 sikuli 进行自动化 Android 测试的文章< /a> 示例是使用滑动锁解锁模拟器屏幕。
阅读您的问题后,我添加了另一个在模拟器被模式锁锁定时解锁模拟器的示例。创建它需要 5 分钟。
I have just published an article about automated android testing using sikuli and the example was unlocking the emulator screen using the slide lock.
After reading your question I added another example of unlocking the emulator when it's locked by a pattern lock. Creating it would take you 5 minutes.
这并不能直接解决您的问题,但可能会帮助您走得更远,并可能帮助其他人。
我使用此函数在重新启动后解锁无密码保护的设备:
This doesn't directly solve your issue but may help you get further along and may help others.
I use this function to unlock a non-password protected device after a reboot: