使用void kill工作从ios 6上的其他应用程序中杀死应用程序 [英] kill application from other application on ios 6 using void kill dont work

查看:134
本文介绍了使用void kill工作从ios 6上的其他应用程序中杀死应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ios 4& 5的调整中获得越狱iphone 6



我使用(void)kill来关闭在后台运行的其他应用程序。
这是我的代码:

  #import SBApplication.h

SBApplication * app;
app = [[objc_getClass(SBApplicationController)sharedInstance]
applicationWithDisplayIdentifier:@my killed program id];
if(app)
[app kill];

现在,当我在ios 6中尝试时,我无法让它工作!
需要帮助吗?

解决方案

只是为了扩展Victors回答一下......你想得到pid来自应用程序,如果它大于0(一个有效的pid),用SIGTERM(Nicer,虽然它不能保证杀死它)或SIGKILL(强制终止)杀死它

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

关于终止信号的信息:
http://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html


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:

#import "SBApplication.h"

SBApplication *app ;
app = [[objc_getClass("SBApplicationController") sharedInstance]
           applicationWithDisplayIdentifier:@"my killed program id "];
if(app)
    [app kill];

now when i trying that in ios 6 i cant get this to work ! need help?

解决方案

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

这篇关于使用void kill工作从ios 6上的其他应用程序中杀死应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆