The ModMyTM Family of Sites:
ModMyMotoModMyiModMyGphone




 
 
Register or Connect with Facebook

Discuss AppStore Apps | Browse / Search Cydia | MMi Cydia Stats




  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > iPhone / iPod Touch SDK | Development Discussion
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 08-27-2008, 06:00 PM
What's Jailbreak?
 
Join Date: Aug 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
[2.0] Launching background processes

I can't see anyone else discussing this, but I am porting an application to 2.0 which should launch another application in the background, similar to the "Ants" application, but it seems launchctl will not work; Is there any way to get this functionality?
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #2  
Old 08-29-2008, 12:11 AM
NetMage's Avatar
Developer
 
Join Date: Aug 2007
Device + Firmware: iPhone 2.2.0
Operating System: Windows XP / OS X
Location: Virginia
Posts: 1,231
Thanks: 45
Thanked 202 Times in 162 Posts

Assuming jailbreak, can you not use the classic Unix fork/exec?

Or are LaunchServices available? (Looking around, I don't see LaunchServices.framework on the phone...)

Last edited by NetMage; 08-29-2008 at 12:19 AM..
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #3  
Old 08-29-2008, 12:22 AM
jakecigar's Avatar
iPhoneaholic
 
Join Date: Aug 2007
Device + Firmware: 2 x 3G iPhone 2.2, pwned
Operating System: OS X 10.5.6
Location: San Francisco, CA
Posts: 475
Thanks: 24
Thanked 108 Times in 93 Posts
Send a message via AIM to jakecigar Send a message via Yahoo to jakecigar Send a message via Skype™ to jakecigar

I did notice that Cydia has a launchctl'ed code file! com.saurik.Cydia.Startup

/System/Library/LaunchDaemons/com.saurik.Cydia.Startup.plist

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.saurik.Cydia.Startup</string>
	<key>Program</key>
	<string>/usr/libexec/cydia/startup</string>
	<key>RunAtLoad</key>
	<true/>
</dict>
</plist>
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #4  
Old 08-31-2008, 06:05 AM
What's Jailbreak?
 
Join Date: Aug 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

It definitely seems like system, fork and exec can be used to launch the executable, but can't use UIKit, or other ways to display graphics, similarly with launchctl -- in both approaches, `ps -A` shows that the process is running, but nothing is made visible.

The nearest thing I've managed to do is copy the binary to a new /Applications/Something.app directory with its own icon and Info.plist with a new CFBundleIdentifier, and use UIApplication launchApplicationWithIdentifier:suspended: -- this allows the application to start and display things, but it uses the whole screen, though my UIWindow is much smaller, and you cannot interact with anything 'behind' the application.

So, it's close, but not quite there yet; Does anyone know any apps on 2.0 which can do this? Looking for something similar to Ants, or the screenshot applications.

Last edited by iguessitisok; 08-31-2008 at 06:13 AM..
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #5  
Old 09-10-2008, 05:12 PM
What's Jailbreak?
 
Join Date: Sep 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

I'm trying to figure out the same thing. The information I've found so far is that you can setup something though launchctl only during the install of your application since that's done as root. After that you can't access launchctl. I've played around with exec and that seems to work, but it was only a very basic app. I'll let you know what else I find out. Keep us posted if you find out more.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #6  
Old 09-10-2008, 10:49 PM
NetMage's Avatar
Developer
 
Join Date: Aug 2007
Device + Firmware: iPhone 2.2.0
Operating System: Windows XP / OS X
Location: Virginia
Posts: 1,231
Thanks: 45
Thanked 202 Times in 162 Posts

Something that could help if you are looking at how Ants was done is to look at the source for Dock:
cre.ations.net - Creation: Dock 3.0: Quick app switching for jailbroken iPhone 2.0 phones

It runs in the background and displays over other programs - there was a special mode required for this to work, and the limitation used to be there can be only one program of this type.

Now he is using the WinterBoard module that allows injecting code into SpringBoard.

Last edited by NetMage; 09-10-2008 at 10:49 PM.. Reason: fix accidental doublepost
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
Reply

  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > iPhone / iPod Touch SDK | Development Discussion

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Go to Top
ModMyI

All times are GMT -6. The time now is 09:21 PM. Powered by vBulletin® Version 3.8.4
If you need Dedicated Server Hosting, you should check out SingleHop. | Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 Copyright © 2007-09 by ModMy, LLC. All rights reserved.

iPhone News / iPhone Forums / Apple News / Apple Forums / RSS / Contact Us / / Privacy Statement / Top