Tuesday, January 24, 2012

Turning an iPad into a kiosk device

So I was asked to set up an iPad so that once an app was running it couldn't be quit. This is becoming a fairly common use case as iPads make their way into retail and other public spaces as kiosk or POS devices.

Looking at MDM solutions and combing the wisdom of StackOverflow didn't tell me how, in fact the resounding answer was "can't be done" or "only with jailbreak".

Of course if you have been into an Apple store recently you will know that this is possible because next to every display device is an iPad running their smart sign app with the home button disabled. So how do they do it?

It is actually really simple. All you need is a mobile configuration profile that sets the iPad into 'Store Demo' mode. The relevant key is SBStoreDemoAppLock in com.apple.springboard.plist and can be set with a config profile.


It is actually pretty trivial to make this work, all you need to do is install a correctly formatted mobile config plist over the air from a web server. It's possible that you can load the config using IPCU too but I have not tried this. You can combine this with whatever other enterprise configuration profiles you have in play. It also works on iPhones.

BEWARE
Once this profile is installed the first app that is launched when the device is rebooted will be the only app that will run until you reboot the device again.
To remove the profile plug the device into IPCU and delete it then reboot the device. Everything will be back to normal.


Hopefully this will help anyone else trying to the same thing only to be told it's not possible.

 <?xml version="1.0" encoding="UTF-8"?>  
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
 <plist version="1.0">  
 <dict>  
   <key>PayloadContent</key>  
   <array>  
     <dict>  
       <key>PayloadDescription</key>  
       <string>Disables home</string>  
       <key>PayloadDisplayName</key>  
       <string>Home Button Lock</string>  
       <key>PayloadIdentifier</key>  
       <string>com.hbkill.kiosk</string>  
       <key>PayloadOrganization</key>  
       <string>My Org</string>  
       <key>PayloadType</key>  
       <string>com.apple.defaults.managed</string>  
       <key>PayloadUUID</key>  
       <string>B2D02E2D-BAC5-431B-8A29-4B91F71C9FC1</string>  
       <key>PayloadVersion</key>  
       <integer>1</integer>  
       <key>PayloadContent</key>  
       <array>  
         <dict>  
           <key>DefaultsDomainName</key>  
           <string>com.apple.springboard</string>  
           <key>DefaultsData</key>  
           <dict>  
           <key>SBStoreDemoAppLock</key>  
           <true/>  
           </dict>  
         </dict>  
       </array>  
     </dict>  
   </array>  
   <key>PayloadDescription</key>  
   <string>Disables Home Button</string>  
   <key>PayloadDisplayName</key>  
   <string>Home Button Lock</string>  
   <key>PayloadIdentifier</key>  
   <string>com.hbkill</string>  
   <key>PayloadOrganization</key>  
   <string>My Org</string>  
   <key>PayloadType</key>  
   <string>Configuration</string>  
   <key>PayloadUUID</key>  
   <string>614D1FE3-F80D-4643-AF6B-D10C4CC8737A</string>  
   <key>PayloadVersion</key>  
   <integer>1</integer>  
 </dict>  
 </plist>  

16 comments:

GMan said...

This looks really promising. I saw your post first on Stack Overflow. But how do actually "install a correctly formatted mobile config plist over the air from a web server"?

I also downloaded IPCU and tried to load your code into it after saving it with the .mobileconfig extension (?), but IPCU tells me that it "contains entries that cannot be managed by iphone configuration utility". Though I have no idea what I'm doing and may not be doing that right.

Any help would be greatly appreciated.

Rick said...

@GMAN
I didn't think that using IPCU would work as the keys for locking the home button are not normally configurable - as the error you get confirms.

To deliver your config from the web all you have to do is direct the iPhone to a url containing the profile. Just open the link to your .mobileconfig file in safari. If you don't have web space you can just use dropbox public folder URLs or switch on your mac webserver.

GMan said...

Awesome. Thanks.

@freshvoice said...

Hi Rick

Many thanks for this - found your original post on Stackoverflow too - but the tip for using Dropbox with the .mobileconfig file was excellent.

We're experimenting using iPod Touch to create content for older people in residential homes, help them keep in contact and avoid isolation - this is an ideal way of locking down unnecessary distractions.

Cheers

Dre said...

Thank you so much for posting this, the portion regarding the "Over the Air" update was genius, and allowed me to resolve an issue where I had sent a MobileConfig profile to an iPad in Texas, from Florida because the computer there would not load the mobile config in the iPCU program.

GMan said...

Worked like a charm. Thanks so much.

Ruthie said...

Thanks for this! Does this setting disable autolock?
My customer is worried about burnout of the screen if autolock is disabled. They want to be sure to have the screen go black or move into screensaver mode if inactive and I am looking for a straightforward solution to that.

Ruthie said...
This comment has been removed by a blog administrator.
Rick said...

No the screen timeout settings are unaffected.
You should check that this still works on the latest OS as some other settings related hacks using config profiles were disabled last update (the home screen shortcuts for example)

Ruthie said...

Will check in this release. Thanks. Just to be clear - when you implemented this the iPad would go to sleep as usual and be woken by the home button?

Rick said...

I don't recall testing for that explicitly as we were always going to disable lock anyway.

I do remember that the iPad we were testing with was sat around with the screen off though and was still in the same app when re-activated. We may have had to use the top lock button to activate the screen though.

You should be able to verify the actual behaviour pretty easily. I think that someone on the stack overflow thread posted up a link to an installable config so you can test quickly.

Anonymous said...

Hello Thanks for this.
I read this twice.

i just want to make home button disable and enable within application. Is it possible?

Thanks a lot in advance.

Rick said...

Sorry no.
Apps can't do anything with the home button without jailbreak.

Alvis Martin said...

Awesome Post!First I read it and I got a lot of info.Thanks for sharing it
i Pad POS

Anonymous said...

Great article, still amazes me how much useless information there is out there, glad I found this.

Is there a way you can lock the ipad into 2 Apps ? Or selected Apps, I have checked guided access, it's just not cutting it. Turning gestures on to swipe between Apps allows swiping between the most recent Apps and access to the home button via pinching. any help ?

Rick said...

Answered here http://rick-hawkins.blogspot.co.uk/2013/05/the-ipad-kiosk-device-redux-how-to-use.html