load an app as a default app

Discussion in 'Jailbreaks and iOS Hacks' started by AMG, Jan 8, 2010.

  1. AMG macrumors newbie

    Joined:
    Jul 5, 2008
    #1
    Hi :)

    I am wondering if there is a utility/tool out there for setting an app (skype, GV Mobile...etc.) to load as a default app (example: phone.app).

    Thanks, AMG
     
  2. Applejuiced macrumors Westmere

    Applejuiced

    Joined:
    Apr 16, 2008
    Location:
    At the iPhone hacks section.
    #2
    I don't think so. Why not load it up with backgrounder and let it run?
     
  3. AMG thread starter macrumors newbie

    Joined:
    Jul 5, 2008
    #3
    With backgrounder I have to load the app myself every time I reboot or respring the phone in order for it to be backgrounded. As you may know, sometimes the iPhone respring itself when it needs so. I want the process to be fully automated sorta like the phone.app which is loaded automatically every time the phone is rebooted or respringed and stays in the background.
     
  4. Night Spring macrumors G5

    Night Spring

    Joined:
    Jul 17, 2008
    #4
    Backgrounder has a setting where you can enable specific apps to always stay backgrounded. Open Backgrounder, tap App-Specific, tap Always-enabled, pick the apps you want to always be backgrounded.
     
  5. thelatinist macrumors 603

    thelatinist

    Joined:
    Aug 15, 2009
    Location:
    Connecticut, USA
    #5
    That only automatically backgrounds apps which you have already manually opened. The OP wants this app to open automatically on boot.
     
  6. Applejuiced macrumors Westmere

    Applejuiced

    Joined:
    Apr 16, 2008
    Location:
    At the iPhone hacks section.
    #6
    Interesting, I dont think there is one.
    Backgrounder will come close but like you said you gotta manually set it up each time.
     
  7. foob macrumors 6502

    foob

    Joined:
    Feb 17, 2009
    #7
    This may be deeper than you want to work but you can use launchd to automatically load things on boot. You just need to write a simple plist to load it. I don't know how well it would work trying to open more than one graphical app at the same time though, seems like it's asking for trouble.

    If I were going to do it, I would time their opening and write a script to execute at boot that loaded them into launchd one by one. The script would be simple like: sleep X seconds (to allow springboard to start); launchctl load app1; sleep 10 (to allow app1 time to return a successful open code); launchctl load app2 ... etc

    Sorry if that's too much. I'm just brainstorming.
     
  8. AMG thread starter macrumors newbie

    Joined:
    Jul 5, 2008
    #8
    That's exactly what I want.

    Thanks for the suggestion. Unfortunately I am not a programmer. I SSHd to my phone last night trying to find something in MobilePhone.app to replicate its behavior of being loaded on boot; I couldn't find something that helps. The closest I found is in here http://www.hackint0sh.org/f126/31658.htm
     
  9. leons macrumors 6502

    Joined:
    Apr 22, 2009
    #9
    I too would like to do this. Any other ideas?
     
  10. KidPub macrumors member

    Joined:
    Dec 8, 2009
    #10
    launchctl is the way to interact with launchd. See this article.

    Perry
    KidPub Press
     
  11. AMG thread starter macrumors newbie

    Joined:
    Jul 5, 2008
    #11
    I have created the following .plist file and placed it in /System/Library/LaunchDaemons/ and rebooted my phone. It didn't work; skype does not load on boot. Is there something wrong in the code?

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>com.skype.skype</string>
    <key>Program</key>
    <string>/private/var/mobile/Applications/194BDC50-8DA1-4BA9-8258-E84D9DEC09BD/Skype.app/</string>
    <key>KeepAlive</key>
    <true/>
    <key>RunAtLoad</key>
    <true/>
    <key>UserName</key>
    <string>mobile</string>
    </dict>
    </plist> 
     
  12. foob macrumors 6502

    foob

    Joined:
    Feb 17, 2009
    #12
    /private/var/mobile/Applications/194BDC50-8DA1-4BA9-8258-E84D9DEC09BD/Skype.app/ only points to the directory, it needs to point to the executable in that directory. It's probably called Skype, but I don't have it to check.

    I am just guessing here, but this will probably try to launch it during boot before SpringBoard opens, which is too early. If it doesn't open, it may keep trying and eventually get it open after SpringBoard is running. I dunno.

    I've never tried this, but if it doesn't work, I would probably try changing it from run at load, to on demand, then call it from a script. You could have launchd run this script at boot:

    Code:
    #! /bin/sh
    sleep 30s
    launchctl load YourSkypePlist
    exit 0
    That would sleep for 30 seconds to give SpringBoard time to open, then load Skype using the launchd plist you created for it. The script would also need it's own plist.

    Another way would be to run the script manually by tapping an icon on SpringBoard. There are generic instructions for doing that on my blog. It would not need a launchd plist, but would need a fake app directory and a different plist in there (I hate apple's plist crap) as explained on my blog. It would be a simpler script:
    Code:
    #! /bin/sh
    launchctl load YourSkypePlist
    If you're new to scripts, save them as a text file then make them executable with iFile or by typing chmod +x NameOfScript in a terminal.

    Again, I've never tried this and have no idea if it'll work.
     

Share This Page