Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
172 views
in Technique[技术] by (71.8m points)

ios - 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?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...