有什么方法能在Tweak中重启手机吗?

请教一下:
有什么方法能在Tweak中重启手机吗?
在越狱设备中,通过代码重启手机?

system("reboot")

谢谢解答。
不过好像用不了啊,
引入了:#include <stdlib.h>
但是还是报:‘system’ is unavailable: not available on iOS
image

#include <mach/mach.h>
#include <stdio.h>
int main(){
  mach_port_t h = mach_host_self();
  mach_port_t hp;
  kern_return_t rc;
  rc = host_get_host_priv_port(h, &hp);
  if(rc == KERN_SUCCESS) host_reboot(h,0);
  printf("sorry\n");
  return 0;
}
2 个赞

谢谢您的解答:
我这面测试了一下,发现rc的值等于4,请问是什么原因?
KERN_INVALID_ARGUMENT 4
/* The function requested was not applicable to this type of argument, or an argument is invalid*/
测试代码::------------
83E25B3F-231C-41BC-B0D9-F41344028F3F
输出结果::-----------
47E74970-C592-4B57-BF99-10B2A2711146

root权限下运行去看看

2 个赞

那关机呢。。。