Question
How do I automate Guided Access mode on an iPhone? I will need to automate the enabling and removal of this feature
Backgr
From what I understand this cannot be done using code. On a non jailbroken device and then you would need to create a daemon that runs as a listener.
The closest thing you can do is set up "Guided Access" on your device and link it to the triple home button press.
More information about guided access can be found here