有什么方法,可以在tweak或则tool中代码执行,可以重新启动springboard

收到通过后,想要自动重新启动springboard

可以直接 kill 进程 SpringBoard

#include <spawn.h>
extern char **environ;
void run_cmd(char *cmd) {
pid_t pid;
char *argv[] = {“sh”, “-c”, cmd, NULL};
int status;
NSLog(@“Run command: %s\n”, cmd);
status = posix_spawn(&pid, “/bin/sh”, NULL, NULL, argv, environ);
if (status == 0) {
NSLog(@“Child pid: %i\n”, pid);
if (waitpid(pid, &status, 0) != -1) {
NSLog(@“Child exited with status %i\n”, status);
} else {
NSLog(@“waitpid”);
}
} else {
NSLog(@“posix_spawn: %s\n”, strerror(status));
}
}
用这个执行定义方法run_cmd(“killall -9 SpringBoard”); 就ok了