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

核能气质少年 提交于 2019-12-02 00:16:07

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

Assuming the second app is yours, you could open the second app with openURL and have it kill itself in the App Delegate callback.

How about good old "kill(pid, signal);"?

If you have appropriate (root?) privileges, it should work for you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!