2

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?

Nate
  • 31,017
  • 13
  • 83
  • 207
LiorKatz
  • 53
  • 7

3 Answers3

0

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

Mundi
  • 79,884
  • 17
  • 117
  • 140
0

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

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

Victor Ronin
  • 22,758
  • 18
  • 92
  • 184
  • Your write in the code something like kill(19, 9); You can read about this command here: http://publib.boulder.ibm.com/infocenter/zvm/v6r2/index.jsp?topic=%2Fcom.ibm.zvm.v620.edclv%2Frtkil.htm If you need to find process PID, take a look here: http://stackoverflow.com/questions/13579775/ios-processes-info-pid-uid-cpu-mem – Victor Ronin Feb 27 '13 at 23:17
0

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