我找到了一个名为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错误。
答案 0 :(得分:0)
我不确切知道你所寻找的是什么,但如果你需要重新启动iphone而你拥有root权限,你就可以杀死关键的系统进程,比如
void reboot(){
system("kill 1");
}
这似乎不是重启手机的优雅方式,但它会做你需要的。