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

ui-auto-monkey script would stop when app go to background #16

Open
vigossjjj opened this issue May 6, 2015 · 4 comments
Open

ui-auto-monkey script would stop when app go to background #16

vigossjjj opened this issue May 6, 2015 · 4 comments

Comments

@vigossjjj
Copy link

Hello,

I face a problem that if tap some button app would go to background, then script stop runing.
For example tap on 3rd login button. How to i solve it?

@JohnnyWuMigme
Copy link

I had same problem while I use auto-monkey doing test. If the monkey taps out of the target app, the instruments will hang over there and nothing can do. Is there a way to detect the thread runs to different app? I notice there is a demo: https://www.youtube.com/watch?v=y5PZGVbLHtI&feature=youtu.be
In this demo, he could detect and stop the monkey, but I don't have idea how did he make it.

screen shot 2015-05-15 at 2 39 12 pm

Currently I use a workaround to overcome this situation. Because we use Monkey as our stress test to try if there is any crash for current version. So I write a script to launch the Monkey for at most 10 mins one time, and set the script in LaunchAgent to run it every 10 mins. In this way to relaunch Monkey and make sure it can run through the whole weekend. But if possible I still would like to know how to detect while it runs to different app.

@JohnnyWuMigme
Copy link

Find another better workaround. Please refer link as below:
http://developer.appcelerator.com/question/40081/ios4---make-app-not-run-in-background

Config the Info.plist file to enable "UIApplicationExitsOnSuspend", in this way if the target app is hidden to background the app will exit right away, so it would cause instruments to be terminated.

But in this way the log will show "2015-05-19 08:51:29 +0000 Fail: The target application appears to have died", which might be confused with real crash. Still have to find a way to detect the status and log it.

@vigossjjj
Copy link
Author

@JohnnyWuMigme @jonathanpenn I refer the CrashMonkey and ui-auto-monkey to make a Project https://github.com/vigossjjj/CrashMonkey4IOS, it fix the app hang,and will relaunch the app to continue working via idevicedebug.

@BruceBGordon
Copy link

Is running with Guided Access on an option? Your script could pause and allow you to enter Guided Access manually. You can also enter programmatically (via objective-c code or swift) if you have a managed device. That requires adding some code to your application and creating a managed iOS device (Meraki is one provider).

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