+ Reply
Results 1 to 2 of 2
  1. #1
    What's Jailbreak?
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question 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.

  2. #2
    What's Jailbreak?
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    My plist now looks like this

    Code:
     <?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>
    but it will not get executed at that time

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts