iOS 7 Single App Mode Change Device Settings - ios

I have a an iOS7 app running in a Single App Mode on an iPad.
The device is put in the Single App Mode via Apple Configurator.
The Single App mode does not respond to the Home Button.
Is there a way a user can access the device settings when running in a Single App Mode (For example change device brightness or turn bluetooth ON)

Short answer is no.
A device running in single app mode will not allow the user to exit the app to access settings.
A possible solution is to use the Restrictions configuration payload with the autonomousSingleAppModePermittedAppIDs key set to the bundle id for your app.
You will need to install a configuration profile either manually or through an MDM with this payload on the device.
Once the profile is installed your app you can enter single app mode programmatically by calling UIAccessibilityRequestGuidedAccessSession.
You can now add some UI (like a button) to permit the user to exit guided access and launch settings, you exit guided access using the same API to enter it.
Note: This won't force the user back to your app once they have exited your app. You will have to find some other way to do that (ugly hack: force install another configuration profile that brings your app back into single app mode, once that has happened, remove this profile but leave the one permitting it to request guided access).

Related

App does not appear in iPad Settings list when iPad connected to Mac as external device

I am developing an iPhone/iPad photo processing app on a Mac using Swift in XCode 13.4. When I connect an iPhone running iOS 15.6 as an external device, the app appear in the Settings list and I can allow it to have access to Photos. When I connect to an iPad running iOS 15.5 as an external device the program runs but fails when trying to access photos using info[UIImagePickerController.InfoKey.phAsset.rawValue]. This is commonly because permission to access photos has not been given to the app. When I tried to set this I found that the app did not appear in the Settings list. The app does appear in the iPhone settings list even though it has never been installed from the App Store.
Okay, so it turns out that you mean you're running from Xcode on the device. Good! But that is irrelevant to the question, as it turns out.
The question is why it is that, on the iPad, there is no entry for your app in the Settings app, is that right? So that would be because on the iPad you've never done anything that causes the app to request permission (such as photos).
The point is, you cannot initiate the granting of permissions from Settings; the app itself must first request permission from the user (using the correct PHPhotoLibrary call). Only after that happens will the app acquire a place in Settings where the user can modify the initial permissions.
Adding a programmatic definition of photo access options as suggested by Matt in main form viewWillAppear solved the problem as per https://developer.apple.com/documentation/photokit/delivering_an_enhanced_privacy_experience_in_your_photos_app. However, iOS 14 or newer is required.

How to check if an app is running in iOS device from a mac terminal

I am trying to launch ios app from python script/terminal using ios-deploy. This is a test app so it might crash and need to relaunch multiple times.
I want to check if this app is currently running or not on the connected device, for my relaunch logic to work. But I am kind of stuck here.
I know idevicesyslog which can capture logs and then parsing logs I can check if my app is currently running or not. But isn't there any sophisticated way to just check if an app is currently running or not in device. Xcode/instruments can get the list of processes via GUI in connected device but I want a command line utility so that I can take certain action.
You can check app or debug app using safari.
Open safari.
And If develop option not available on top navigation bar then open preferences of safari and in advance tab tick show develop option in below that screen.

iOS App Update Process using single app mode (SAM)

We have an enterprise app that will run through our MDM in ASAM (Autonomous Single App Mode). We will install it through the MDM but need to be able to detect and initiate updates programatically without user interaction.
From the thread I gather this is possible for enterprise apps as long as they are not currently the front running app.
BTW all ipads will be managed and supervised so we have complete control of them.
We are following somewhat the plan laid out in comments above:
1) Have Single App Mode running on target app
2) Ping our server to identify a new update available (compare current version to listed version)
3) Disable Single App Mode on target app
4) Launch Maintenance App (just shows image saying "Maintenance Mode...Please Wait")
5) Push update to target app
6) Relaunch Target App
7) Re-enable Single App Mode on target app
The question I have is around Step 5 above.
Typically we would initiate the update through a browser to start the download and update of the application, however I need this instead to be initiated automatically, I would assume by the maintenance app.
How would I programatically initiate an update to an enterprise app without prompting the user to accept the update? Or is this something I have to push through the MDM and can't be called on from an app within the ipad?
Thanks in advance for your help.

Lock iOS app in single app mode programmatically

Note : I don't want to submit this app to app store.
What i want to achieve :
I want simple app with one view having two button Lock and Unlock.
Lock - This button will lock device. Only this app's screen will show nothing else will be accessible even after restart same screen will show up. Home button, gestures will get disabled similar to single app mode.
Unlock - This will unlock device and switch to normal behaviour of device.
iOS :
I want this for iOS 4.3 and above.
I have checked following solutions, but these don't match my requirements
Configuration profile
Lock-down iPhone/iPod/iPad so it can only run one app
But it is manual (reboot device, open app which you want to run in single app mode). I want to do it programmatically the way i mentioned above through my app.
Guided access (iOS 6 and above)
How to lock down user to Single App mode in iOS 6, Programmatically?
I want it do for all os and programatically.
Is there any way to do this ? As i don't wan't to submit it to app store is there any private api, some hack for springboard to achieve this ?
Thanks in advance !!
As I know in iOS 7 there is a new feature which allow to do exactly what you want.
However, it's only applicable for iOS 7 (and I believe it's only applicable to a supervised devices).
1) You will need to install restriction configuration profile with autonomousSingleAppModePermittedAppIDs key (take a look here)
This is one time step and a user will need to manually accept this configuration profile.
There is another option to use MDM to install it silently, but it could be an overkill for you.
2) You should use API:
UIAccessibilityRequestGuidedAccessSession (to lock/unlock)
It is defined here
3) And most beautility part. All of it is officially document. So, you can even submit it to AppStore.
P.S. Why do you care about 4.3 or 5? They have tiny market share by now. Most likely even iOS 6 has below 20% market share already.
Update 1
Potentially, you can try to use API which sends clicks and keys (search for GSEvent in iPhone-privateapi tag). May be using these API's you can do triple home to toggle accessibility on and off.
If this work, I think you should be able to cover iOS 6. I am not sure whether both this API and triple home click were available prior that.
It looks like this private API is unaccessible anymore in iOS 7. So, probably you can ignore this idea.
Just wanted to write on this even though this is old as i needed to implement a similar solution and i got it working. The steps for me as follows and a note here is that this involves MDM and other specific steps.
My requirement was as follows. Each of the iPad at different locations has a set of apps installed.For ease of it lets assume each Dept. has their own apps. Participants open a app related to their dept. to take a test, the APP automatically Locks the iPad to single-app Mode and at the end of the test, it will unlock it self.
Supervise the iPad/iphone using the Apple Configurator.
Install the MDM related files ( Each MDM has its own set of instructions, usually involves downloading a profile).
Every MDM has a option of Single APP Mode or MultipleAppMode. Select the second option and add the app IDs to the list. (A single APP mode works pretty well with MDM's but i did not want the app to be locked to a single APP all the time).
I used the UIAccessibilityRequestGuidedAccessSession api to lock unlock the device from single app mode.
http://bobxcode.blogspot.com/2015/12/programmatically-implement-single-app.html
Thanks,
Bob
In MDM configuration, There is an option
autonomousSingleAppModePermittedAppIDs
Optional. Supervised only. If present, allows apps
identified by the bundle IDs listed in the array to
autonomously enter Single App Mode.
Availability: Available only in iOS 7.0 and later.
But this needs Supervised Device mode.

Can I set an application to launch everytime iOS device is unlocked?

Is it possible to set a certain iOS app (with whatever necessary user permissions) to launch automatically each time the phone is unlocked?
No. The only ways to start an app are:
from the springboard
through a user acting on a local or push notification posted by your app
from another app using an URL scheme
Not one that will make it to the appstore...

Resources