views:

309

answers:

2

Hi All,

I just want to know how to kill a back ground process/app in iphone. Just like in Auto Lock SBSettings where, the "process" toggle is able to list all the back ground process and allows user to kill any of them.

Thanks in advance.


Thanks 'refulgentis', 'Chuck' for your quick responses.

You're true and also I know that the Apple's public API doesn't allow me to do so. In a jail broken phone how could I do this? How "SBSettings" 'processes' toggle is doing the same?

My requirement is to kill and restart my "Phone (MobilePhone.app)" application. In this case how can I proceed further?

Can you please give me some sample piece of code?

+4  A: 

You can't, using the public API. Anything you write wouldn't be allowed on the App Store.

For jailbroken apps, just use ps -ax and kill.

refulgentis
What about things like Memory Info, which are in the App store and do similar tasks? It seems to do memory management directly with the OS, and seems to kill the iPod task.
Erich
They don't kill apps. They load data into memory so much that the iPhone starts to quit running apps (such as mail, and safari) to free up memory to accommodate the frontmost app. Then when it quits, it releases all its memory, effectively freeing up all the memory it was occupying.In my opinion this is bad behaviour.
Jasarien
Also, note that Apple cleared house of memory management apps a few months ago (Google iStat for more info). I wouldn't rely on this being an acceptable approach.
refulgentis
Thanks 'refulgentis' your quick responses.You're true and also I know that the Apple's public API doesn't allow me to do so. In a jail broken phone how could I do this? How "SBSettings" 'processes' toggle is doing the same?My requirement is to kill and restart my "Phone (MobilePhone.app)" application. In this case how can I proceed further?Can you please give me some sample piece of code?
prathumca
+2  A: 

Since you aren't allowed to have any background apps running on the iPhone, this turns out to be something of a non-issue.

Chuck
that's not really true--there are lots of apps running in the background, it's just that you aren't allowed to write more of your own.
David Maymudes
That's what chuck was trying to say. You're just being pedantic.
Jasarien
no, *Chuck* was saying something else--I was trying to point out that it's very reasonable for the OP to wish there were a way to shut down the background tasks that are, in fact, running.
David Maymudes