Closed husaria closed 8 years ago
After you wake up the device you should swipe to unlock it. The easiest way to generate the code would be using culebra -G
, opening the Drag Dialog, specify the coordinates for your specific device and you'll have the code you can put in a swipeToUnlock()
method.
See the details at http://dtmilano.blogspot.ca/2014/11/culebra-magical-drag.html
This shows an example of culebra
unlocking a phone by swiping (using Drag Dialog).
The generated code would look like this:
device.wake()
device.dragDip((168.67, 606.0), (168.67, 378.67), 1000, 20, 0)
vc.sleep(1)
Hi Diego,
thanks for your replay, I just was not sure if I don't miss any additional option for device.unlock()
, I was able to figure out something like that (it works perfectly for my Samsung S5, Samsung Galaxy Tab S and Sony Xperia T2 Ultra - which is good enough for me):
from com.dtmilano.android.adb.adbclient import AdbClient
def swipe_to_unlock(serial_no):
dev = AdbClient(serial_no)
disp_inf = dev.getDisplayInfo()
w = disp_inf["width"]
h = disp_inf["height"]
dev.drag((0.5*w, 0.9*h), (0.5*w, 0.4*h), 300)
Great. I'm glad to hear you found the solution to your problem.
I've got following simple script to unlock device (no passcode or anything set):
Device is just woken up but no unlocking is done. Is this method should do unlocking when swipe is needed? Should I do the "swiping" in some other way? What would be the best solution? I cannot find any swipe method.