Objective C - Terminate all other apps running in the background - ios

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.

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.

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

Related

Can a third party app prevent other IOS apps being opened or used?

This question was asked a couple of years ago (iOS app Blocker possibilities) and I'm wondering if there is anything that has changed in IOS since this question was answered in 2017 that would allow a third party app to prevent an app from being opened or used (that doesnt use the Device Enrolment Program)?
As mentioned in the linked post, the freedom app prevents the use of other apps via a VPN. I am wondering if there is a more straightforward means of a third party app blocking other apps or whether sandboxing means that the use of a VPN is the only way of a third party app blocking other apps?
I am not an expert, but it seems like Freedom is routing an iPhone's network traffic through a "local" VPN. This means that, while you could open an app like Chrome and navigate to google.com, Freedom's VPN would not forward the request.
I haven't installed or tested the app, but their website is carefully worded: "Install App Blocker" to install the Freedom app blocker. This blocks content on other browsers like Google Chrome and for apps."
I read "blocks content" to mean you can open the app, but it will fail to load content without a network connection. I haven't tested, but I suspect that you could still use "offline" apps.
Here is a screen grab of their website.
As you noted, Apple's mobile device management (MDM) solution is capable of preventing apps and other activities. Here is the list for MDM restrictions, and a list of Supervised restrictions.
It's my belief that a third-party app cannot prevent another app from functioning. Freedom is playing a network trick. To stop an app from actually booting would require a jailbreak. But I haven't explored this space in depth.

Extract Enterprise app's IPA in iOS 9

As you know, Apple disabled app extraction in iOS 9. But in this case I'm talking about an enterprise app not bought apps from App Store.
Is there anyway to backup or better to say extract IPA of installed apps in an iOS 9 device?
Thanks
Apple remove this feature for various reasons. See:
Why did Apple kill App extraction in iOS 9?
3 very good reasons which we believe pushed Apple to completely remove app extraction from iOS 9:
App Slicing
Because universal apps are destined to be stripped, extracting the .ipa package from an iOS 9 device doesn’t make much sense anymore: it may only be installable on a device with identical resolution.
Frequent Updates Improve Security
Blocking app extraction will effectively shorten the lifespan of stale versions of apps, improving overall security of the iOS ecosystem.
Preserve Disk Use
All these backed up apps quickly add up, and can result in literally tens of gigabytes of outdated apps eating up your precious hard drive space.
If you'd like to have a backup of your app, you can try to use iMazing app for backing up and restoring application data.

How can my app detect that it was distributed via the new TestFlight?

I'm going to use Apple's relaunched TestFlight service to distribute a beta, and I'd like to force a certain message to be visible when running as a beta.
Obviously there's a lot of ways to solve this, but it got me thinking; has Apple provided a way to detect if the currently running app was distributed via TestFlight? iOS clearly differentiates it to the user, so I thought there'd be a way for the developer to tell, as well. Alas, I haven't found anything in the Apple Developer site.

Is there no way I can develop for iOS without paying money? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
The community reviewed whether to reopen this question 2 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I code for fun mostly and perhaps would later want to freelance. I currently program for Android and have released a few apps for free. The point is just to build the applications, not to earn money from them, so I don't have ads on them either.
I thought I'd expand my skills to iOS, but found that I have to buy a mac and also pay a yearly fee to Apple for publishing my apps on the iOS app store.
Maybe I'm not understanding something here or I'm missing some vital piece of info. Is there no way I can code and distribute my app on the store for free and without purchasing an expensive macbook? I just bought a new Sony VAIO and I can't afford another computer (and I don't need one either).
Have I got all the facts right or am I missing something?
You are more or less right.
You need to pay the yearly fee to Apple in order to distribute apps.
You need a Mac to run Xcode and develop for iOS.
However, the Mac Mini, even some of the older models, will run Xcode alright, so there might be money to save there.
Also, once you have a mac, you can build apps and run them on a simulator without paying the Apple Developer license - but you do need to pay the $99 to publish them and even run them on your own iPhone.
I don't agree with Apple on all of these restrictions, but it is their decision and there is not much to do about it.
I should also mention that you can buy Mac OSX and run it virtually on non-Mac hardware, but doing that is against Apple's license terms, and therefore illegal. Though it might be interesting for you to do this I would not recommend it due to the legal issues.
One final option for you would be to rent a Mac in the cloud and connect to it (via VNC, Remote Desktop), to try it out - but for real development on a device, you still need actual Mac hardware.
There appear to be at least a couple online services which will allow you to rent time on a Mac in the cloud (to use remotely via RDP or VNC from your PC). Make sure the Mac on which you rent time has the latest version of Xcode and iOS SDK installed and available for use, and you can use that for all iOS development except direct device debugging.
Access to Apple's App store requires paying to enroll in their Developer program.
The absolutely free option is to develop iOS web apps. These can be made clippable with a custom icon, run off-line with a suitable manifest and MIME type, and can be downloaded from your own web site or server, no App store approval required.
To develop app for iOS, you need:
Xcode, which means you need MacOS. Usually, you would need a Mac computer (iMac/MacBook/etc.), but you can also install MacOS on VM. I'm not sure if it is possible to set up an environment as replacement for Xcode.
Run and test the app. iOS simulator is OK, but there might be subtle difference between the simulator and the real device. If you want to test on real device, you need to join the Developer Program, or you can also jailbreak the real device and go through a clunky process (involving packaging the app, and copy the app to the device via command line) to run the app.
Somewhere to distribute your app (as a product). You need the Developer Program (again), if you want to distribute the app on Apple AppStore. If you want to distribute app for jailbroken device, you are free to do so, without any restriction.

Objective C - Check running processes

good afternoon, I'm developing for iOS using phonegap, but I need to modify some objective C code and I was looking for information, but I cant found anything about how to check the amount of running processes in the device (iphone or ipad)
There are no public APIs for this. The reason is that Apple probably doesn't want you doing it, because it violates their app-sandboxing philosophy. And really, there's no reason for you to do it in an AppStore app, because you are guaranteed to be more-or-less the only app running when you are running. There may be some music players or VOIP apps in the background, but they user probably wants them there, they are not pertinent to your app, and there's nothing you can do about them anyway.
What is the reason you want to list the running processes on the device?

Resources