go-ios icon indicating copy to clipboard operation
go-ios copied to clipboard

ios reboot is not working

Open deepakarorawins opened this issue 2 years ago • 4 comments

Describe the bug When execute "ios reboot" command nothing happens on the device.

To Reproduce Steps to reproduce the behavior:

  1. ios-go is installed via "npm -g install ios-go"
  2. Open terminal and execute command "ios reboot"
  3. 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]

deepakarorawins avatar May 02 '22 07:05 deepakarorawins

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

shamanec avatar May 10 '22 14:05 shamanec

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).

briankrznarich avatar Aug 10 '22 11:08 briankrznarich

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 avatar Mar 05 '23 13:03 ssadoun

@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.

briankrznarich avatar Mar 06 '23 04:03 briankrznarich