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

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

  2. #2
    Green Apple
    Join Date
    Oct 2009
    Location
    Maryland
    Posts
    37
    Thanks
    1
    Thanked 5 Times in 3 Posts

    Quote Originally Posted by Dinosaurus View Post
    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.
    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.

  3. 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)

  4. #3
    What's Jailbreak?
    Join Date
    Nov 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  5. #4
    Green Apple
    Join Date
    Oct 2009
    Location
    Maryland
    Posts
    37
    Thanks
    1
    Thanked 5 Times in 3 Posts

    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

  6. #5
    What's Jailbreak?
    Join Date
    Dec 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quote Originally Posted by Kapolani View Post
    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 "x8fx2ax00x00" >> 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.

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

  7. #6
    What's Jailbreak?
    Join Date
    Dec 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

  8. #7
    Green Apple
    Join Date
    Oct 2009
    Location
    Maryland
    Posts
    37
    Thanks
    1
    Thanked 5 Times in 3 Posts

    Quote Originally Posted by MisticRain View Post
    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..??
    putty in and change your permissions.

    You have to make it executable. Pretty sure that's the problem.

  9. #8
    What's Jailbreak?
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    How do you then switch back to a proper code signing identity to submit your app to the App Store?

  10. #9
    Green Apple
    Join Date
    Oct 2009
    Location
    Maryland
    Posts
    37
    Thanks
    1
    Thanked 5 Times in 3 Posts

    Quote Originally Posted by x68507 View Post
    How do you then switch back to a proper code signing identity to submit your app to the App Store?
    As far as I know you _have_ to purchase a developer's license.

  11. The Following User Says Thank You to Kapolani For This Useful Post:

    x68507 (12-15-2009)

  12. #10
    What's Jailbreak?
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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

  13. #11
    Green Apple
    Join Date
    Oct 2009
    Location
    Maryland
    Posts
    37
    Thanks
    1
    Thanked 5 Times in 3 Posts

    Quote Originally Posted by x68507 View Post
    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.
    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.

  14. #12
    What's Jailbreak?
    Join Date
    Dec 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  15. #13
    Green Apple
    Join Date
    Oct 2009
    Location
    Maryland
    Posts
    37
    Thanks
    1
    Thanked 5 Times in 3 Posts

    Quote Originally Posted by chiark View Post
    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
    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.

  16. #14
    What's Jailbreak?
    Join Date
    Feb 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  17. #15
    Green Apple
    Join Date
    Oct 2009
    Location
    Maryland
    Posts
    37
    Thanks
    1
    Thanked 5 Times in 3 Posts

    Quote Originally Posted by rdfrahm View Post
    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
    I haven't messed around with it in a while.

    One thing I can think of:

    Did you make sure the script that I had you run is _now modified_ to point to your new directory?

    If I get around to it I'll poke around and see if I remember anything.

  18. #16
    What's Jailbreak?
    Join Date
    Feb 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quote Originally Posted by Kapolani View Post
    I haven't messed around with it in a while.

    One thing I can think of:

    Did you make sure the script that I had you run is _now modified_ to point to your new directory?

    If I get around to it I'll poke around and see if I remember anything.
    Thanks for the reply and your efforts Kapolani. I'm not sure what you mean by this:

    "Did you make sure the script that I had you run is _now modified_ to point to your new directory?"

    Could you explain?

    Thanks,
    Rich

  19. #17
    What's Jailbreak?
    Join Date
    Feb 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quote Originally Posted by rdfrahm View Post
    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
    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

  20. #18
    What's Jailbreak?
    Join Date
    Feb 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quote Originally Posted by rdfrahm View Post
    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
    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

  21. #19
    What's Jailbreak?
    Join Date
    Jul 2009
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

Posting Permissions

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