user3191334
user3191334

Reputation: 1168

Objective C - Terminate all other apps running in the background

I need to develop an enterprise application, which should be able to close all other Apps which are currently running via multithreading on non-jailbreaked iOS-devices.

Some years ago I had an App called PKiller or Process Killer, which listed all currently running applications including their program ID and was able to close them. It was an App published in the official AppStore but of course Apple took it down, due to the violation of their guidelines.

Does anybody know how to get currently running processes and shut them down?

(again this App will not go to Apple / the AppStore, due to the fact, that it's an enterprise Application)

EDIT:

I did deeper researches and found out, that you can't even get any running or installed Apps and the connected information like the PID anymore in iOS 9. Apple made the sysctl no longer accessible to sandboxed iOS 9 apps. Also other methods in order to get any third PID failed in iOS 9.

Upvotes: 3

Views: 1018

Answers (2)

wottle
wottle

Reputation: 13619

There was a way to do it in the past, but as of iOS 9, it will no longer work. The library that was used for this, sysctl is no longer accessible to sandboxed iOS 9 apps.

In iOS 9, the sandbox now prevents a process from accessing the kern.proc, kern.procargs, and kern.procargs2 values for other processes

and

iOS apps are not permitted to see what other apps are running

https://developer.apple.com/videos/play/wwdc2015-703/

There may be another way, but it certainly will not be as easy as it was a couple of years ago, and not without major effort that Apple will be looking to shut down, even for enterprise apps.

Upvotes: 2

Sandeep Kumar
Sandeep Kumar

Reputation: 899

I believe you can't do that because apple won't allow you to access the data out side on your application sandbox.

Upvotes: 2

Related Questions