How can I close an app with system("/usr/bin/killall [appname]"); i used it but when I double tap on Home button to show background app. it still appear. May help? I deverlop on Jailbroken phone, I want to clear call_history.db, I guess I want to close MobilePhone app perfectly, after that I can delete on call_history.
Asked
Active
Viewed 506 times
3
-
I really want to know this answer. +1 for asking such question – Niru Mukund Shah Mar 20 '13 at 04:35
1 Answers
2
I am not 100% sure for this answer. However, I believe if you double tap Home button it doesn't show you a list of background apps. It shows you a list of recently used apps.
As example, system may stop some of this apps due to low memory, but they are still on this list. If you click on any of stopped apps, they will be started by system again.
Based on this understanding. Most likely Killall actually worked fine (killed an app), but the app stayed in recent apps list. You don't need to worry about this list for your task.

Victor Ronin
- 22,758
- 18
- 92
- 184
-
I try to delete from call_history.db with MobilePhone is openning and it still appear on Recent Call, but when I close MobilePhone by double tap Home button and open it again, it not appear. – user1561904 Mar 20 '13 at 18:07
-
That's odd. I am not sure. May be there is additional some daemon running which is stopped, when you stop MobilePhone through UI and which keeps call history. Try to get a list of processes, stop MobilePhone through UI and get list of processes again and compare it. – Victor Ronin Mar 20 '13 at 20:30
-
1+1. This is correct. If you `killall` the app, the process is gone, but it will still show in the recently used app list (Double-Press Home Button). [See Apple doc here](http://support.apple.com/kb/ht4211), or [other answer here](http://stackoverflow.com/a/11117564/119114). – Nate Mar 20 '13 at 22:54
-
system("/usr/bin/killall MobilePhone"); I don't know how it returns? – user1561904 Mar 21 '13 at 01:36
-
-
Sorry for my English :D It means: "The return value of "system("/usr/bin/killall MobilePhone")" " – user1561904 Mar 21 '13 at 18:11
-
@user1561904: Not a problem. I am not a native speaker either :) Take a look at this (for a return value) http://www.cplusplus.com/reference/cstdlib/system/ – Victor Ronin Mar 21 '13 at 19:31