Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function: lockForDuration() is failed to unlock the simulator #11

Open
JohnnyWuMigme opened this issue Feb 17, 2015 · 3 comments
Open

Comments

@JohnnyWuMigme
Copy link

Hi Jonathan, please allow me to call you teacher. Thanks for your great book and tool, I really studied a lot from them.

I encounter a problem in using the Monkey tool. When I call lockForDuration() in my script, most of time it's unable to unlock the simulator (sometimes it could, I don't know why), the log shows:

2015-02-16 14:02:06 +0000 Debug: target.lockForDuration("0.01863725995644927")
2015-02-16 14:02:07 +0000 Debug: target.systemApp().mainWindow().scrollViews().firstWithPredicate("ANY elements.name == 'SlideToUnlock' OR ANY elements.name == 'SlideToSetup' OR ANY elements.name == 'Passcode field'").dragInsideWithOptions({endOffset:{x:0.90,y:0.90}}, duration:"0.5", startOffset:{x:0.20,y:0.90}}})
2015-02-16 14:02:09 +0000 Debug: Unlock failed. Retrying up to 2 more time(s).
2015-02-16 14:02:09 +0000 Debug: target.systemApp().mainWindow().scrollViews().firstWithPredicate("ANY elements.name == 'SlideToUnlock' OR ANY elements.name == 'SlideToSetup' OR ANY elements.name == 'Passcode field'").dragInsideWithOptions({endOffset:{x:0.90,y:0.90}}, duration:"0.5", startOffset:{x:0.20,y:0.90}}})
2015-02-16 14:02:10 +0000 Debug: Unlock failed. Retrying up to 1 more time(s).
2015-02-16 14:02:10 +0000 Debug: target.systemApp().mainWindow().scrollViews().firstWithPredicate("ANY elements.name == 'SlideToUnlock' OR ANY elements.name == 'SlideToSetup' OR ANY elements.name == 'Passcode field'").dragInsideWithOptions({endOffset:{x:0.90,y:0.90}}, duration:"0.5", startOffset:{x:0.20,y:0.90}}})

I use Xcode 6.1, simulator is iPhone 6. I want to trace the lockForDuration() but I don't know where the code is in my OSX. Do you have any idea or hint that I can move on? Thanks teacher!

@skrach
Copy link

skrach commented Feb 17, 2015

I have the same problem. UIATarget.lockForDuration()successfully locks the device, but fails to unlock it afterwards. It seems as if the sliding gesture to unlock the device is not sufficient.

@jonathanpenn
Copy link
Owner

Alas, if the function isn't working, then it is the fault of the Automation instrument and the script can address the problem. File a bug with Apple and post the bug number here for reference for anyone to dupe.

@JohnnyWuMigme
Copy link
Author

Bug number: 19933099
https://bugreport.apple.com/problem/viewproblem

Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants