iphone4s感觉好几天不重启会比较卡,就每天凌晨4点定时重启下系统吧。
1、ios定时任务配置文件
info.chenpeng.iphone.plist
<?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>Label</key>
<string>info.chenpeng.iphone.plist</string>
<key>POSIXSpawnType</key>
<string>Interactive</string>
<key>ProgramArguments</key>
<array>
<string>/var/mobile/chenpeng/cron.sh</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Minute</key>
<integer>0</integer>
</dict>
<key>LowPriorityIO</key>
<true/>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
<key>UserName</key>
<string>root</string>
<key>KeepAlive</key>
<false/>
<key>LaunchOnlyOnce</key>
<false/>
<key>RunAtLoad</key>
<false/>
</dict>
</plist>
2、需要每小时跑任务的脚本
cron.sh
执行日志如下:
另外我还加了个每小时上传iphone系统信息、网络信息到服务器的任务,以防丢失,嘿嘿。