-
11-27-2009, 08:11 AM #1
Can I install my own home made Xcode made apps on my jailbroken iPhone?
I've Googled and searched the forums but can't seem to find clear information on what I want to do. I have a Hackintosh with Leopard and the latest SDK (3) and it runs great. I've been building my own little apps and want to see if I can install them on my iPhone without signing up for the Apple Developer Program. Eventually I'd like to if I want to sell my apps.
I have an iPhone 3G which I jailbroke and unlocked on 3.1.2 firmware. I have OpenSSH and AppSync for OS 3.1 installed.
I'm wondering if it is possible to build a project from Xcode and install and run it on my iPhone to test it. Any help would be great.
-
11-27-2009, 09:18 AM #2
Yes.
I just did the very same thing over the weekend.
Your next major hurdle is defeating Apple's code signing.
These are the steps I took to do this:
This is assuming 'Developer' is the directory where you installed xCode.
1. Edit: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/SDKSettings.plist and change CODE_SIGNING_REQUIRED from YES to NO.
2. Run this script:
#!/bin/bash
cd /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS\ Build\ System\ Support.xcplugin/Contents/MacOS/
dd if=iPhoneOS\ Build\ System\ Support of=working bs=500 count=255
printf "\x8f\x2a\x00\x00" >> working
dd if=iPhoneOS\ Build\ System\ Support of=working bs=1 skip=127504 seek=127504
/bin/mv -n iPhoneOS\ Build\ System\ Support iPhoneOS\ Build\ System\ Support.original
/bin/mv working iPhoneOS\ Build\ System\ Support
chmod a+x iPhoneOS\ Build\ System\ Support
3. In project settings set Code Signing Identity and Any iPhone OS Device to 'don't code sign.'
4. In Project Set Active SDK and Active Build Configuration accordingly.
4. In Project select Build tab and set Configuration to Release.
I did this as well, but I don't think you need to:
You need to create a self-signed certificate in your keychain to sign your apps with. To do this, run the Keychain access utility from the Utilities folder on your Mac. In keychain access, click on Certificate Assistant -> Create a certificate from the Keychain access menu. In the certificate name field, enter "iPhone Developer" and choose "Self Signed Root". Check the "Let me override defaults" box and click continue. On the next screen, enter a serial number (Any number will do as long as it's not already used in a certificate). Change the certificate type drop down to "Code signing." Fill in your details on the next screen and then click continue through the rest of the screens.
-
The Following 3 Users Say Thank You to Kapolani For This Useful Post:
Freerunnering (05-14-2010), justinede (11-27-2009), tcunningham1589 (05-11-2010)
-
11-27-2009, 09:29 AM #3
Thanks Kapolani! I can't wait to try it. I found some info similar to this but it's great to hear from someone that has it working.
-
11-27-2009, 10:17 AM #4
Sorry guys.
I built a new project using my post and found that I missed something.
You have to do this as well:
Open your project settings in Xcode and add two user defined settings as follows:
Project settings -> edit project settings -> Press build tab -> show [User-Defined Settings]
Add these to settings:
Setting: PROVISIONING_PROFILE_ALLOWED Value: NO
Setting: PROVISIONING_PROFILE_REQUIRED Value: NO
-
12-11-2009, 10:07 PM #5
I'm a noob at this stuff. I'm confused. I'm trying to manually run each line of the script at the terminal screen. I keep getting an error message that the directory does not exist when I type at the terminal screen " cd /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS\ Build\ System\ Support.xcplugin/Contents/MacOS/" (more specifically, I can:
cd Developer.
cd Platforms
cd iPhoneOS.platforms
cd Developer
cd Library
cd Xcode
cd Plug-ins
but after that I can not cd iPhoneOS ( I think it has something to do with the spaces in the directory name?)
I'm using sdk 3.1.2 and xcode 3.1.4.
Please advise what I'm doing wrong...
-
12-14-2009, 06:37 AM #6
did all youre steps and got a release build of my app.. ssh-ed it to my device but cant start it? it starts and then stops directly. The app works in the emulator..??
-
12-14-2009, 06:36 PM #7
-
12-15-2009, 06:45 AM #8
How do you then switch back to a proper code signing identity to submit your app to the App Store?
-
12-15-2009, 07:11 AM #9
-
The Following User Says Thank You to Kapolani For This Useful Post:
x68507 (12-15-2009)
-
12-15-2009, 08:43 PM #10
Kapolani, thanks for your help so far. From reading other posts more, I suggest that once a code is fully developed, the user should save a "fresh" copy that doesn't have the xcode tweaks that you mentioned, then all the user has to do is sign up for the IDP.
Last edited by x68507; 12-15-2009 at 08:58 PM. Reason: Figured out question
-
12-16-2009, 07:19 AM #11
I haven't really looked that much into it.
But, you have to pay a fee and sign up with their developer program. They then issue you keys/certificates that will enable you to distribute your code after it's reviewed by the appstore. I think the license lasts for a year.
This only needs to be done if you want to distribute to NON jailbroken phones.
-
12-18-2009, 09:06 AM #12
Kapolani, thanks for this guide - it's pretty much perfect!
One further expanation: if you want to run the compiled app on a jailbroken iphone, that hasn't got a modified MobileInstallation file (as AppSync gives you, if I understand correctly) you need to codesign it. You can do this by following your instructions, creating the key, creating the package, then from terminal codesign -s "iphone developer" compiled.app
More explanation on Saurik's blog: Bypassing iPhone Code Signatures - Jay Freeman (saurik)
Thanks again! This is just what I wanted
-
12-19-2009, 04:47 PM #13
Oops. Sorry. I forgot to add one more crucial element.
You have to sign the code. You can download an app from Cydia - search for ldid - Link Identity Editor. Run the cmd line command (search google for the command) to sign the code - use MobileTerminal.
Glad you got it to work.
-
02-03-2010, 06:03 PM #14
Sorry to open an old thread but I've been working on this for awhile and can't get it to work. I think I followed the instructions perfectly, yet when I tried to build my app I got a message that said something like "Code sign error: a valid provisioning profile matching the application's identifier XXXX could not be found". That was the first time I tried it...but now every time I load my project into XCode, XCode crashes with no explanation. I have the active SDK set to Device 3.1.2 and the Build Configuration set to Release. I have an iPhone 3G running 3.1.2 firmware (jailbroken of course) and XCode 3.1.4.
One place I deviated from the instructions is in step 1, where it says to modify the SDKSettings.plist file in the iPhoneOS3.0.sdk folder. I modified the one in the iPhoneOS3.1.2.sdk folder. Is that right?
Any ideas?
Thanks,
Rich
-
02-06-2010, 08:40 AM #15
-
02-07-2010, 09:33 AM #16
-
02-13-2010, 08:01 PM #17
OK...I got around this problem. I uninstalled and reinstalled Xcode and now I can build my app and scp it to the iPhone. But when I do this:
ldid -s /Applications/myapp.app/myapp
I keep getting this error:
util/ldid.cpp(660): _assert(0:signature != NULL)
I haven't been able find any useful information on this message. Can anyone tell me what it means and how I can resolve it?
Thanks,
Rich
-
02-15-2010, 06:08 PM #18
Damn! Now it's back to crashing Xcode as soon as I set the Active SDK to iPhone Device 3.1.2. But this time another reload of Xcode didn't solve the problem. Very annoying. Has anyone else ever seen this? Or, can anyone tell me how I can debug it to see what's causing it?
Thanks,
Rich
-
05-11-2010, 12:19 AM #19
Hello,
I would like to know if those instructions here are still valid. I had a look at the Saurik's page where he actually explains how to copy the app to the iPhone but not how the build the app.



LinkBack URL
About LinkBacks
Reply With Quote
