0

I want to create an app that has the sole purpose of quitting the Waze app.

The app is launched when I get in the car automatically (Bluetooth connect trigger with Activator). The annoyance is that you have to go into the menu and press the power button icon within Waze to make it go into sleep mode. In my opinion they should offer an option to always go into sleep mode if you press 'home', but they don't. So I'd like to create an app that will be launched by the Bluetooth disconnect trigger from Activator and then closes Waze and closes itself. I know how to code that second part, but I've no idea how I can close another running/background application.

I tried killall Waze or killall com.waze.iphone without success.

Note: it's for jailbreak only.

Neeku
  • 3,646
  • 8
  • 33
  • 43
Pieter
  • 1,751
  • 3
  • 30
  • 65
  • Doesn't each app get it's own user id? In which case that would cause a *permission denied* error unless the current user has root access. – trojanfoe Jun 27 '14 at 12:33
  • You mean process ID? If so, no, the apps are not in the list if you run 'ps aux' or 'ps aux | waze'. – Pieter Jun 27 '14 at 12:36
  • 1
    You can get list of all the processes programmatically using this http://stackoverflow.com/questions/7729245/can-i-use-sysctl-to-retrieve-a-process-list-with-the-user Find the one you need and kill it with this `kill(pid, SIGKILL)`. – creker Jun 27 '14 at 14:33
  • Doesn't work: Only the app that's running in foreground is included in the process list. – Pieter Jun 30 '14 at 21:41
  • 1
    Are you sure `killall Waze` doesn't work? It works for me logged in with SSH as root on the command line. How were you calling it? – newenglander Jul 15 '14 at 07:47
  • It does work.. Strange. Must have mistyped something the first time. It appears that "killall Waze" also kills the app if it's in background (it's still in the springboard app switcher, but if it's launched you get the start screen again..) I'll accept it as an answer if you put it as one ;) – Pieter Jul 15 '14 at 19:24

0 Answers0