我找到了一个叫libimobiledevice的开源库,好像有个叫restored_reboot的函数可以做到,于是我写了这样的代码:
void reboot(){
restored_client_t client = NULL;
restored_error_t result = restored_client_new(device, &client, "mylabel");
if(result == 0){
result = restored_reboot(client);
if(result != 0)
fprintf(stderr, "failed to reboot: %d\n", result);
}else{
fprintf(stderr, "failed to create client, %d\n", result);
}
restored_client_free(client);
}
但是失败了,restored_reboot返回了-3,这意味着plist错误。
最佳答案
我不完全知道这是否是你要找的东西,但如果你需要重启 iphone 并且你有 root 权限,你可以杀死关键的系统进程,比如
void reboot(){
system("kill 1");
}
这似乎不是重启手机的优雅方式,但它会满足您的需要。
关于iphone - 如何在 PC 上重启越狱的 iPhone,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16539670/