go-ios
go-ios copied to clipboard
ios reboot is not working
Describe the bug When execute "ios reboot" command nothing happens on the device.
To Reproduce Steps to reproduce the behavior:
- ios-go is installed via "npm -g install ios-go"
- Open terminal and execute command "ios reboot"
- Following logs appeared: - {"level":"info","msg":"no udid specified using first device in list","time":"2022-05-02T12:35:35+05:30","udid":"
"} {"level":"info","msg":"ok","time":"2022-05-02T12:35:35+05:30"}
Expected behavior Device with should reboot
Actual behavior Device stays as is.
Desktop:
- OS: [MAC OS]
- Version [12.3.1]
Smartphone:
- Device: [iPhone11]
- OS: [iOS15.4.1]
I did some debugging on this and I noticed that the issue occurs because of the 'WaitForDisconnect' field being sent to the 'com.apple.mobile.diagnostics_relay' service. I haven't debugged the service itself(not that I can actually do it properly) but I tested out and only the 'Request' field is actually needed by the service to successfully reboot the device - 'WaitForDisconnect', 'DisplayPass' and 'DisplayFail' seem to be obsolete. Still there is probably a reason that it was implemented like this and I'll refrain from fixing stuff by just removing stuff and leave this as information that could potentially help @danielpaulus fix it
P.S.: This seems to occur for the first reboot only. I also tested:
- Removing 'WaitForDisconnect' field
- Rebooting the device successfully without it
- Adding 'WaitForDisconnect' back
- Attempting to reboot again - successful
Thanks for the investigation @shamanec. Just want to chime in and confirm the issue. We are aware of circumstances where a reboot fails with go-ios, but succeeds tidevice. (In otherwords, there's a working implementation that can be referenced https://github.com/alibaba/taobao-iphone-device)
Seems to be most prevalent when the phone is severely hosed up (in other words, exactly when you need to be able to remotely reboot).
I've encountered a similar phenomenon. For me, it was not the "first reboot", but many reboots later.
Much like @deepakarorawins, I'm using iOS 15.4.1 as well (iPhone 13 connected to a Windows PC). Recently, I have noticed some issues when using the 'ios reboot' command (which used to work just fine).
Could this be related to the iOS version?
@ssadoun Certainly go-ios's behavior could be tied to IOS device version.
I am not sure I have ever had
idevicediagnostics restart
fail to restart a device. Maybe give that a try for comparison.