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

handle errors during debugserver startup and add helper function #459

Merged
merged 1 commit into from
Apr 23, 2020

Conversation

Ukalnins
Copy link

Sometimes, when device is restarted and ios-deploy mounts the new image, user may get "invalid service" error due to race condition while ios is scanning the image.

While debugging this error, I also received "cannot send message" error in the same place, so I added handling for both errors.

As the same pattern is repeated a lot of times, added helper function.

@gabebear
Copy link

OOoof... you seem to be correct.

I'd like to play with this a bit; I will look at this sometime today. It hits a lot of code that as far as I know uses a lot of guesswork on what Apple is doing.

@Ukalnins
Copy link
Author

For the race condition for mount I mostly followed the "Console" output and just made an assumption that the "ImageMounted" event within iOS is processed asynchronously from MountImage call, so it just made sense.

@ivanhernandez13
Copy link

I'm unable to repro the original issue, the change itself looks fine to me. It's essentially trying once more on error.

I wish there was a way around using sleep and instead listening for the actual event but I'm not aware of a way to do that.

@Ukalnins
Copy link
Author

I haven't been able to reliably repeat it on any 64bit device. I was seeing this problem on our 32bit device pool that needs constant reboots due to other problems, so I tested on 5C with idevicediagnostics -u .. restart && sleep 45 && ios-deploy -b .. -i ... --noninteract -m -d that failed in around 1 in 4 times. One day it was invalid service, the other - cannot send message, so it's probably also related to moon-phases or something.

@gabebear gabebear merged commit d3e898f into ios-control:master Apr 23, 2020
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

Successfully merging this pull request may close these issues.

3 participants