The iPad is a great bit of tablet hardware — it’s got a great multitouch sensor, a pretty zippy processor, built in WiFi, etc. No one thing is the kicker, but it’s the combination of all the things in one simple form factor that make it pretty compelling. These same strengths are also the same sorts of things you want in a standalone kiosk. And, it turns out that the iPad is great for that as well — with a little bit of modification.
To run in a kiosk mode, we want to set up the iPad to do a few things such as automatically starting our specific application and to keep it running if someone tries to quit the app or restart the app if it crashes for some reason. You can get part of the way there by getting an enclosure that restricts access to the hardware buttons. However, because iOS is unix-based, you can go further.
This process requires a jailbroken iPad and we neither condemn nor condone the process. Please be aware of the potential risks and limitations of jailbreaking your device which has evolved considerably with the introduction of iOS 5. If you don’t know what you’re getting into, please don’t consider it.
So, starting with a jailbroken iPad, you’ll want to install the following packages (all available through Cydia):
- openssh (to enable ssh access, this will require a reboot)
- sbsettings (to enable ssh control)
- nano (text editor, there’s no vi/emacs/etc)
- open (to launch apps from the command line)
- top (optional – if you ever want to know a process id or what’s running… ‘ps’ is not in iOS)
- IncarcerApp (optional – disables the hardware-based home button, but isn’t needed if you have an enclosure)
Creating the StartUp / KeepAlive script
- SSH to the iPad.
- In /Library/LaunchDaemons/ create a launch daemon plist script, named something like com.yourcompany.startUp.launchd.plist:
- Test things out while still logged in via ssh:
- In Settings -> General, set “Use Side Switch to:” to “Lock Rotation” (if you need to keep the iPad oriented in a specific direction). And, toggle the side switch. ;)
- In Settings -> General, set “Auto-Lock” to “Never” (to keep the device from going to sleep)
- In Settings -> General, set “Multitasking Gestures” to “Off” (may not be an option on all iPads)
- In SBSettings, set “Show Icon” to “Off”. (the icon will stay visible until the next reboot)
- Remove any provisioning which will expire during the period that the app will be in use. This can be modified in Settings -> General -> Profile. If multiple profiles are installed, tapping any profile will bring up a red, “Remove” button. Tap this button to delete the profile. When profiles are set to expire, a blue popup dialog box will be displayed on the iPad until the provisioning is removed.
- If users have access to the hardware buttons (around the iPad’s periphery and the Home Button, you’ll need to set up IncarcerApp to disable the buttons.
Disabling the Autostart (i.e., please don’t run in kiosk mode any more)
The single best way to stop the autostart routines is to unload the plist mentioned above and modify it to prevent the App from launching after a restart:
This will take a little bit of timing, a network connection, and the ability to use SSH.
- If Incarcerapp is being used, disable it so you can use the Home Button (the round hardware button).
- Press the Home Button to quit the ASH App — the app will try to relaunch in a few seconds, so the next step may require a few tries.
- Swipe the status bar at the top of the screen (where the network connection and time are displayed). This will slide down a panel of information in the upper left of the display. Near the bottom of that display, make note of the WiFi IP Address.
- Using the SSH login details from the Script section above, connect to the iPad. It’s fine if the app relaunches during this and following steps.
- Unload the script with launchctl unload /Library/LaunchDaemons/com.secondstory.startUp.launchd.plist
- You can now quit the app using the Home Button and use the device as needed.
- If you want to leave the script permanently disabled, modify the script above to alter the appBundleID.
If the iPad is not connected to a WiFi network:
- You can try and get connected via Settings -> General -> Network. This may require multiple attempts while the app restarts.
- You can connect to the iPad in iTunes and temporarily delete the App from the iPad. The App will need to be reinstalled in order to use it again.