kill application from other application on ios 6 using void kill dont work

后端 未结 3 1043
天命终不由人
天命终不由人 2021-01-21 15:55

i got jailbreak iphone ios 6

in my tweak on ios 4&5 I used (void) kill to close other app running in the background. this is my code:



        
3条回答
  •  深忆病人
    2021-01-21 16:45

    Just to expand on Victors answer a bit... you want to get the pid from the application and if it is greater than 0(a valid pid), kill it with either SIGTERM(Nicer, though it's not guaranteed to kill it) or SIGKILL(Forceful Termination)

    SBApplicationController *appController = [objc_getClass("SBApplicationController") sharedInstance];
    SBApplication *app = [appController applicationWithDisplayIdentifier:appId];
    if (app.pid > 0)
        kill(app.pid, SIGTERM);
    

    Info About Termination Signals: http://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html

提交回复
热议问题