Skip to main content
Get your Wikispaces Classroom now:
the easiest way to manage your class.
Pages and Files
Add "All Pages"
These are console apps that are started using launchctl. They can be set to start automatically at iPhone boot and can be ran as the mobile user to allow reading prefs files from the right folder.
Can run all the time
Not killed by Springboard
The configuration application needs to be configured in a special way to be able to use launchctl to start or stop the daemon, because usually root access is required. A work around is to have the executble in the info.plist a shell script which in turn runs the real app binary that needs to be chmod 4755. Xcode can't deploy apps that have a shell script as the main exe because signing fails, thus a few post build steps are required.
A Cydia install routine can do the launchctl for you, however you would need to find a way to control the daemon from your app, for example send notifications for it to re-read configuration files. It might be easier to just stop the daemon and start it again.
Since 2.0, daemons can't have a UIApplicationMain thus can't have user interfaces such as UIAlertViews.
MobileSubstrate plugins for Sprinboard
Running all the time
Can't be unloaded
Need an interprocess message technique such as Darwin notifications to communicate from a control app. Same issue as with the daemon technique above.
MobileSubstrate plugin that overrides SBApplication kill for the app
This technique involves a lightweight MobileSubstrate plugin that does one thing. It overrides the SBApplication kill method and reads from the App's info.plist and checks if kill should be overridden. Thus kill can be prevented in many cases when it would normally succeed, e.g. Watchdog timer, memory warnings, terminate from Springboard, jettison.
Develop the application as normal in Xcode
Simply override applicationSuspend
Isn't 100% reliable.
If the phone is reboot the app doesn't start up. (How does Phone and Mail do this?)
Holding the home button to kill will be overriden too.
Need a switch in the app to enable or disable background mode. It isn't possible to suspend the app from code so if you have a button that says run in background now and then call suspend the app will look like it has crashed and vanishes. I suppose a status bar icon could alleviate the worry about that.
NoKill in our own SVN. NoKill is the MobileSubstrate Plugin and NoKillDemo is an app that will run all the time.
help on how to format text
Turn off "Getting Started"