Saturday, June 20, 2009

Use XCode 3.1.2 to build SDK 3.0 app to 3.0 Device without provisioning profile

The trick to skip Provisioning Profile for the new XCode 3.1.3 (iPhone SDK3.0) does not work now. The only thing you can do is to use the old XCode 3.1.2 <Old XCode Dir> to build app for 3.0 device if you don't have the official provisioning profile, until new method to skip provisioning profile can be found.

What you need is to install the new iPhone SDK 3.0 (XCode 3.1.3) in a new directory (non-default dir) <New XCode Dir> and copy the SDK3.0 and the necessary device support files to XCode 3.1.2 and use it build app to 3.0 device.

You need to do the followings:

(1) Create a symbolic link from <New XCode Dir>/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk
to <Old XCode Dir>/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

(2) Create a symbolic link from <New XCode Dir>/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0 (7A341)
to <Old XCode Dir>Developer/Platforms/iPhoneOS.platform/DeviceSupport/

(3) Backup the folder of <Old XCode Dir>/Developer/Platforms/iPhoneOS.platform/Developer/usr

(4) Replace the folder of <Old XCode Dir>/Developer/Platforms/iPhoneOS.platform/Developer/usr
by <New XCode Dir>/Developer/Platforms/iPhoneOS.platform/Developer/usr

(5) Edit the <Old XCode Dir>/Developer/Platforms/iPhoneOS.platform/Info.plist to have the magic keys, may be you have already done so. You can refer to this for instruction.

Info.plist:Select all

<key>OverrideProperties</key>
<dict>
<key>CODE_SIGN_CONTEXT_CLASS</key>
<string>XCiPhoneOSCodeSignContext</string>
<key>DEBUG_INFORMATION_FORMAT</key>
<string>dwarf-with-dsym</string>
<key>EMBEDDED_PROFILE_NAME</key>
<string>embedded.mobileprovision</string>
<key>SDKROOT</key>
<string>iphoneos2.2.1</string>
<key>PROVISIONING_PROFILE_ALLOWED</key>
<string>NO</string>
<key>PROVISIONING_PROFILE_REQUIRED</key>
<string>NO</string>

</dict>


(6) Create a self signed identity say "iPhone Pwned Developer" in your Mac (you probably have this already) see Apple Guide here

(7) Remember to restart Xcode (your old Xcode 3.1.2)

(8) Install the Installd Patch for OS 3.0 to your 3.0 device. This package is in Tweaks Section from the Cydia Source http://iphone.org.hk/apt/ which is released by me. Please reboot device after installation of this package.

(9) Create New Project in in XCode 3.1.2 and in Info.plist, add the magic key of SignerIdentity, you probably know this already. (update, you don't need this after installd patch and for OS 3.0 or above)

<key>SignerIdentity</key>
<string>Apple iPhone OS Application Signing</string>


(10) Use the codesign identity as created in step 6 above to codesign the binary and Build and Go to 3.0 device

P. S. I did not copy the Simulator SDK 3.0, because I can use the iPhone SDK 3.0 in <New XCode Dir> to test 3.0 Simulator. If you want to update the documentation in your old XCode, it is in <New XCode Dir>/Developer/Platforms/iPhoneOS.platform/Developer/Documentation

You can use move instead of symbolic link, if you want to uninstall the <New XCode Dir>


For those who wants to get the iPhone SDK 2.2.1 (XCode 3.1.2) , try the direct download link here (you need to login your developer account)

iPhone SDK 2.2.1 direct download link
http://developer.apple.com/iphone/download.action?path=/iphone/iphone_sdk_for_iphone_os_2.2.1__9m2621a__final/iphone_sdk_for_iphone_os_2.2.19m2621afinal.dmg

iPhone SDK 2.2 direct download link
http://developer.apple.com/iphone/download.action?path=/iphone/iphone_sdk_for_iphone_os_2.2__9m2621__final/iphone_sdk_for_iphone_os_2.2_9m2621_final.dmg


iPhone SDK 3.0 (Xcode 3.1.3) Leopard direct download link
http://developer.apple.com/iphone/download.action?path=/iphone/iphone_sdk_3.0__final/iphone_sdk_3.0__leopard__9m2736__final.dmg

iPhone SDK 3.0 (Xcode 3.2) Snow Leopard direct download link
http://developer.apple.com/iphone/download.action?path=/iphone/iphone_sdk_3.0__final/iphone_sdk_3.0__snow_leopard__final.dmg


iPhone SDK 3.1 with Xcode 3.1.4 Leopard direct download link
http://developer.apple.com/iphone/download.action?path=/iphone/iphone_sdk_3.1__final/iphone_sdk_3.1_with_xcode_3.1_final__leopard__9m2809.dmg

iPhone SDK 3.1 with XCode 3.2.1 for Snow Leopard
http://developer.apple.com/iphone/download.action?path=/iphone/iphone_sdk_3.1__final/iphone_sdk_3.1_with_xcode_3.2_final__snow_leopard__10a432.dmg

iPhone SDK 3.1.2 with XCode 3.1.4 for Leopard
http://developer.apple.com/iphone/download.action?path=/iphone/iphone_sdk_3.1.2__final/iphone_sdk_3.1.2_with_xcode_3.1.4__leopard__9m2809.dmg

iPhone SDK 3.1.2 with XCode 3.2.1 for Snow Leopard
http://developer.apple.com/iphone/download.action?path=/iphone/iphone_sdk_3.1.2__final/iphone_sdk_3.1.2_with_xcode_3.2.1__snow_leopard__10m2003.dmg

iPhone SDK 3.1.3 with XCode 3.1.4 for Leopard
http://developer.apple.com/iphone/download.action?path=/iphone/iphone_sdk_3.1.3__final/iphone_sdk_3.1.3_with_xcode_3.1.4__leopard__9m2809a.dmg

iPhone SDK 3.1.3 with XCode 3.2.1 for Snow Leopard
http://developer.apple.com/iphone/download.action?path=/iphone/iphone_sdk_3.1.3__final/iphone_sdk_3.1.3_with_xcode_3.2.1__snow_leopard__10m2003a.dmg

iPhone SDK 3.2 beta 4 with Xcode 3.2.2 (Snow Leopard)
http://developer.apple.com/iphone/download.action?path=/iphone/iphone_sdk_3.2_beta_4/iphone_sdk_3.2_beta_4_with_xcode_3.2.2.dmg

iPhone SDK 3.2 with Xcode 3.2.2 (Snow Leopard)
http://developer.apple.com/iphone/download.action?path=/iphone/iphone_sdk_3.2__final/xcode_3.2.2_and_iphone_sdk_3.2_final.dmg

Updates: use this script to patch "iPhoneOS\ Build\ System\ Support". If you think the use of dd utility is fragile, don't use it.

patch.sh Select all

#!/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



Enjoy.
.
.
.

48 comments:

  1. Yeah noticed that today. Any other work around. I would like to have a single SDK installation

    BTW: Thanks a million for installd patch

    ReplyDelete
  2. That sucks, I wish the old way still works!

    ReplyDelete
  3. IMHO that's better than nothing. This way we can code using the new 3.1.3 including Simulator and if we need to proof-test it on hardware, we can fire up 3.1.2.

    Thumbs up for the writeup in such a very short time after I requested it! Thanks a million. This way I can purchase the subscription when I need it, not when Apple thinks I do (and waste paid days).

    ReplyDelete
  4. Yeah, it's a pain in the ass when I want to debug on-device, but still better than nothing. Thank you!

    ReplyDelete
  5. Thank you!

    It's a great solution. Maybe it needs some preparation (linking or copying etc.), but it works. There is no big difference between 3.1.2 and 3.1.3, so it's not a problem to use 3.1.2 and I don't know why you people complain on it.
    Just copy dirs listed in the art instead of linking, add docs and sim, then remove 3.1.3 and you will have one, working sdk.
    Again, thank you!

    ReplyDelete
  6. I just debugged my app with 3.1.3. Just need to replace one file.
    http://darkfader.blogspot.com/2009/06/xcode-313.html

    ReplyDelete
  7. Thank you!! As a hobbyist developer uncertain about publishing anything, I am constantly frustrated by Apple's provisioning nightmare. Your guide got me building again onto iPhone OS 3.0.

    For those who don't care about keeping the newer, incompatible Xcode 3.1.3, you can simplify this a bit. Just install 3.1.3 (iPhone SDK 3.0) to a non-default location, and move over the 3.0 SDK, 3.0 DeviceSupport, usr (replace), and iPhone Simulator (replace) to your standard Xcode install. Then you can get rid of the newer install completely.

    ReplyDelete
  8. any idea where I can get Xcode 3.1.2?

    ReplyDelete
  9. DarkFader's way doesn't work for me. It crashes Xcode. I triple-checked his guide. :(

    ReplyDelete
  10. What is the version of SDK that contains XCode 3.1.2? Is it SDK 2.0? Please confirm.

    ReplyDelete
  11. You are awesome. I was just about to lose hope with my 3.1.3 install before I stumbled across the post. It works *flawlessly*. Thank you!

    ReplyDelete
  12. #!/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

    00002a8f is the PIC address of the implementation of a method which returns zero, and file address 255*500 is the location of the IMP attribute of the method responsible for code signing a product (and, incidentally, complaining when you do not have a provisioning profile).

    ReplyDelete
  13. Yess!!! You rock! Now I can develop my own apps and put them on my iPod Touch! Thanks so much. Also, I jailbroke my iPod just to do this, and also so glad that I did that. It was all worth it.

    ReplyDelete
  14. http://www.iphonedevsdk.com/forum/iphone-sdk-tools-utilities/20983-sdk-3-0-xcode-3-1-3-build-go-jailbroken-device-2.html

    The patch from this forum work for me , no need to replace plugin file anymore.

    ReplyDelete
  15. Has anybody gotten the Installd patch to work on the 3GS? Works fine on my iPhone 2G but I get "This provisioning profile does not have a valid signature." Any ideas? Thanks!

    ReplyDelete
  16. mikawber : did you add your 3GS in the organizer as a development device ?

    ReplyDelete
  17. Hmm, I've tried everything at least 3 times, but still my app just crashes on launch. Any tips?

    ReplyDelete
  18. @Christophe yes of course, but when I try to "Build & Go" I get that error above. Thanks

    ReplyDelete
  19. Thanks Anonymous,
    your shell work perfectly for me.

    ReplyDelete
  20. Method using patched iPhoneOS Build System Support.xcplugin: http://www.alexwhittemore.com/?p=270

    ReplyDelete
  21. Hi,

    I’m looking for the one as all needed, please give me the exact clear steps(if anyone successfully done it..!) to know how we can transfer our '3.0' build .app into '3.0' iPhone without doing downgrade of Xcode etc and transfer that with Xcode 3.1.3 itself?

    Need help urgently to test my app.

    Thanks and appreciate your helps.

    ReplyDelete
  22. Btw, I'm success installing 3.0 build in my 3.0 iPhone.

    thanks.

    ReplyDelete
  23. Gys, help here, can't find iphoneos.platform folder only see macosx.platform folder in developer folder, downloaded from javacom''s given 2.2.1 iPhone sdk link.

    ReplyDelete
  24. Works like a charm!

    THANKS VERY VERY MUCH!!!!! ;-)

    ReplyDelete
  25. Much easier way: go to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk and edit the SDKSetting.plist file so that "DefaultProperties/CODE_SIGNING_REQUIRED" and ENTITLEMENTS_REQUIRED are set to NO.

    Also works on 3.1

    ReplyDelete
  26. hi anonymous,

    man your a genius! It's just fucking working like a charm!

    You guys should do this right now!

    ReplyDelete
  27. THis last solution doesn't work for me...

    ReplyDelete
  28. i have a 3gs on 3.0.1 and can't get this to work. Does the phone need to be jailbroken?

    ReplyDelete
  29. can this be done without jailbreaking

    ReplyDelete
  30. No jailbreaking required. This should work on any device and also works with Xcode 3.2.
    If you haven't updated Xcode and the SDKs to use the 3.0.1 update it won't work. To update paste this into Terminal: ln -s /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0\ \(7A341\) /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0.1

    ReplyDelete
  31. this hack works with xcode 3.2 on snow leopard??

    ReplyDelete
  32. I'm interessed too!! :) thanks

    ReplyDelete
  33. newb question. how do I edit the SDKSetting.plist file so that "DefaultProperties/CODE_SIGNING_REQUIRED" and ENTITLEMENTS_REQUIRED are set to NO. Seems like I don't have the permission to do that.
    Do I still need the InstallID patch?
    Would love to be able to get ipas onto the phone without jailbreaking.

    ReplyDelete
  34. Will this also work with iphone OS 3.1 (not 3.0) ? And yes, what about snow leopard?

    ReplyDelete
  35. To change the file, copy it to your desktop then open in. Save it and drag + drop back in place of the original. Will work on 3.1, just change from the 3.0 to 3.1 directory.
    All you need installed is the SDK and Xcode, no patches

    ReplyDelete
  36. What about new version of Xcode iPhone 3.1

    ReplyDelete
  37. ok figured out how to edit the plist file. i still get this error Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain
    using xcode 3.2 and os 3.0.1

    ReplyDelete
  38. this method works also with the new iphone firmware and sdk

    ReplyDelete
  39. I'm redoing this again on snow leopard right now, seems to be fine. And a second developer installation of 5 GB hardly matters now with 640 GB iMac :).

    ReplyDelete
  40. I confirm that this works on Snow Leopard, although for some reason when I 'build and go' and then press the home button, or some error happens, I get this: error from debugger: putpkt: write failed: Broken pipe. Not sure if its because of SL, but anyway.

    ReplyDelete
  41. Yes, jailbreaking must be required, how else would you get the installd patch?

    ReplyDelete
  42. Hi,

    I am on Snow Leopard:

    I followed all the Steps, but I have a strange Problem

    First I installed the Old 2.2.1 SDK. When I Tried to run it, I created a test project and tried to build, just to test If the old version works. But it never finished building. It Stops building when trying to compile the first XIB in the Interface Builders Files. After 10 Minutes I cancelled the build:

    Then, I thought I´ll just Try to follow your Instructions. They seem to work for Skipping the Previsioning Profile Check, but I still have the Problem that it wont Compile any XIB Files.

    Anyone any Idea?

    ReplyDelete
  43. I found out some more: For some Reason, i can not uninstall Dev Tools completely, not even with the terminal command: sudo [path] uninstall-devtools --mode=all . Terinal removes a lot of files when running that script, but when I want to reinstall, it always says "Update" instead of "Install" in the Installation-Options. So there seem to be some remainder of the xcode Tools. I guess that could be the problem, has anyone any Idea how to completely remove the Dev Tools?

    Even restarting after deinstallation an changing Development Directory and changing system Language did not work.

    ReplyDelete
  44. dude, sorry for my noobness but i think it's effing complicated, i have the 2.21 SDK installed, tried the old way, but couldn't find the iphoneOS info.plist in the folder that i was meant to.. anyways i wanted to ask that if i do this will i be able to export an ipa game that i made using "shiva" (game dev program), btw i seriously can't understand his intructions..

    ReplyDelete
  45. I'm having the same problem as Paul... Just sits at compiling MainView.xib. Any ideas? So close...

    ReplyDelete
  46. does this work with xcode 3.2.1 as well?

    ReplyDelete
  47. For this error what can the problem ?
    "Code Sign error: a valid provisioning profile matching the application's Identifier 'com.yourcompany.Test1' could not be found"

    Until now i tried: creating a certificate in keychain, modifing de project settings (PROVISIONING-NO), app info.plist with SignerIdentity, also modified info.plist and sdksettings.plist.

    Any idea ? Thanks

    ReplyDelete
  48. Would it be possible to reupload the older SDKs?

    ReplyDelete