Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone reboot programmatically

I have code

system("reboot") 

The reboot command works in the terminal, but even if I run the app as root, the operation is still denied. Has anyone found any way that works, or can explain a bit about SBSetting's reboot, which makes me curious?

like image 295
philions Avatar asked Jun 21 '11 02:06

philions


People also ask

How do I make my iPhone restart automatically?

Press and quickly release the volume up button. Press and quickly release the volume down button. Press and hold the side button. When the Apple logo appears, release the side button.

How do I programmatically restart an iOS app?

You cannot restart an iOS Application in any case, even if you're able to do using some private api your application will be rejected by Apple and will not be considered for App store release.

Can I force restart my iPhone from my computer?

To do that, connect your iPhone to your computer and start iTunes. Next, perform a force-restart of your iPhone but don't let go of the button(s) when the Apple logo appears. Instead, keep holding until you see the recovery mode screen -- the screen with the iTunes logo and Lightning connector.

How do I manually reboot my iPhone?

To restart your iPhone, press and hold down the Power and Volume buttons until a slider appears on-screen. If restarting doesn't work, you can trigger a "force restart" by pressing Volume Up, Volume Down, and then Power.


1 Answers

I have finally found a way to programmatically restart an iOS device without rooting a device!!!! The command line tool to restart an iOS device is called libimobiledevice:

http://krypted.com/mac-os-x/use-libimobiledevice-to-view-ios-logs/

It is truly amazing. One snag I ran into while installing was trying to install this line:

brew install -v --devel --fresh automake autoconf libtool wget libimobiledevice

However I got around the install problem by running this line:

brew install -v --fresh automake autoconf libtool wget libimobiledevice

After that problem, I followed the rest of the instructions and voila!

Most of the commands can be found on this page: http://krypted.com/uncategorized/command-line-ios-device-management/

The magic command that restarts the iOS device is:

idevicediagnostics restart

What is truly amazing about this tool is not only restarting an iOS device but also outputting iOS device logs to mac's terminal app using the following command:

idevicesyslog
like image 107
Ray Avatar answered Dec 31 '22 20:12

Ray