问题
Note - I have not delved very deeply into Apple's iPhone SDK yet.
However, based on another question asked recently, I'm wondering if, since the iPhone is running some stripped-down edition of Mac OS X if it doesn't have a crontab feature.
If so, how would you access it?
Thanks.
回答1:
Seems that cron runs by default on the iPhone, you just need to be able to edit the crontab file - either the root one or the user one but not the user one apparently.
There are issues with sleep and cron, but there's a good discussion at that link.
回答2:
The iPhone does run cron - but you won't be able to use it in any application developed solely with the SDK. There is absolutely no support for background process or background launching via alarms or timers (e.g. crontab).
回答3:
It appears the iPhone no longer runs crons nor has crontab (2012, iPhone 4s jailbroken, iOS 5.01)
回答4:
You can't use cron on an un-jailbroken iPhone.
Maybe you could take advantage of the Push Notification service: Have cron (or some other scheduler) running on another machine which sends notifications to the phone at the appropriate time.
来源:https://stackoverflow.com/questions/350128/is-the-iphone-cron-able