Thread: Need help with launchd
-
01-24-2009, 08:26 AM #1
Need help with launchd
Hi,
I'm working on a way to get a decent "Night Mode" on my iPhone.
I already figured out how to shut down audio completely (com.apple.mediaserverd.plist) but what I now need is a way to schedule my two scripts to turn audio off and back on. Normally I would do that kind of stuff with cronjobs, but since firmware 2 does not have cron, but launchd instead, I ran into problems.
I can't figure out how the XML file is supposed to look like, and I don't know If I have to load it every time I reboot my iPhone.
So I need to execute /private/var/mobile/silent.sh on Saturday 1:00 and /private/var/mobile/loud.sh on Sunday 13:00 and so on (different times on different weekdays...)
So I really need some help guys, especially since I'm a Linux guy and don't exactly now my way around Apples OS!
Maybe If someone of the more sophisticated developers has some time, we could whip up a real App with a GUI out of this!
Any help very much appreciated
Last edited by Ult_avatar; 01-24-2009 at 08:29 AM.
-
01-25-2009, 12:29 PM #2
My plist now looks like this
but it will not get executed at that timeCode:<?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>com.silent-hour</string> <key>ProgramArguments</key> <array> <string>/private/var/mobile/silent.sh</string> </array> <key>StartCalenderInterval</key> <dict> <key>Hour</key> <integer>20</integer> <key>Minute</key> <integer>15</integer> </dict> </dict> </plist>



LinkBack URL
About LinkBacks
Reply With Quote