目标C -终止在后台运行的所有其他应用程序

时间:2021-11-21 00:34:22

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.

我需要开发一个企业应用程序,它应该能够关闭目前在非越狱的ios设备上通过多线程运行的所有其他应用程序。

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.

几年前,我有一个叫做PKiller或Process Killer的应用程序,它列出了所有当前运行的应用程序,包括它们的程序ID,并且能够关闭它们。这是一款发布在官方AppStore上的应用,但由于违反了他们的指导方针,苹果当然把它撤了下来。

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)

(同样的,这个应用不会去苹果/ AppStore,因为它是一个企业应用)

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.

我做了更深入的研究,发现在ios9中,你甚至不能再获得任何运行或安装的应用程序以及像PID这样的连接信息。苹果公司使sysctl再也不能被装在沙盒里的iOS 9应用程序访问。在ios9中,为了获得第三个PID的其他方法也失败了。

2 个解决方案

#1


2  

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.

过去有一种方法可以做到这一点,但在iOS 9中,它将不再有效。用于此目的的库,sysctl已经无法访问sandboxed的iOS 9应用程序了。

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

在iOS 9中,沙箱现在阻止进程访问内核。proc,科恩。procargs,科恩。其他进程的procargs2值

and

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

iOS应用程序不允许查看其他应用程序在运行什么

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

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.

或许还有其他办法,但肯定不会像几年前那么容易,而且如果没有重大努力,苹果也会寻求关闭,即便是企业应用。

#2


2  

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

我相信你不能这么做,因为苹果不允许你在你的应用程序沙箱*问数据。

#1


2  

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.

过去有一种方法可以做到这一点,但在iOS 9中,它将不再有效。用于此目的的库,sysctl已经无法访问sandboxed的iOS 9应用程序了。

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

在iOS 9中,沙箱现在阻止进程访问内核。proc,科恩。procargs,科恩。其他进程的procargs2值

and

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

iOS应用程序不允许查看其他应用程序在运行什么

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

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.

或许还有其他办法,但肯定不会像几年前那么容易,而且如果没有重大努力,苹果也会寻求关闭,即便是企业应用。

#2


2  

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

我相信你不能这么做,因为苹果不允许你在你的应用程序沙箱*问数据。