Where is the OS X iPhone Disk Image?

Discussion in 'iPhone/iPad Programming' started by shadowband, Jul 13, 2008.

  1. macrumors member

    Joined:
    Jan 10, 2004
    Location:
    massachusetts
    #1
    I'm stuck at step 1 of the "Installing OS X iPhone" section of the iPhone Developer Program User Guide.

    Step 1: Download the OS X iPhone Disk Image (.dmg) from the iPhone Dev Center for the apple device you are using.

    I've scoured the site to no avail. I did find something on the apple forums that stated the following:

    The disk image used to be available when beta versions were being distributed. The only way to get the v2.0 firmware (iPhone OS) is to use iTunes and upgrade to the latest version. You have to click "other" although the correct firmware version is selected, then find the ISPW file that is in the /user/library/itunes/ folder and point to that. Then you can follow the how to and everything starts making sense. Apple's how to is just out of date on this.

    I've scanned my entire hard drive for all .ispw files, and still no dice. I'm at a dead end at this point, so any suggestions are welcome. Thanks.
     
  2. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #2
    Go to http://developer.apple.com/iphone/ login and then the download link is on the top of the page. It will be grayed out until you do login though.
     
  3. thread starter macrumors member

    Joined:
    Jan 10, 2004
    Location:
    massachusetts
    #3
    OK - I just figured this out, so I'll post my own reply to help out anyone else with this issue.

    My iPhone is a new 3G model, and it shipped with build 5A345; however, the current version is build 5A347. Attempting the check for new SW via iTunes results in a "software is up to date" message (which is incorrect). In order to force a SW update to the latest rev, select "Restore", which accomplishes two items:

    1) it force installs the latest SW rev (5A347 in this case)
    2) it downloads the iPhone Disk image!

    A local iPhone disk image is required to "restore" the iPhone into a development platform, and item 2 (above) resolves this issue.
     
  4. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #4
    Ah, sorry thought you meant the SDK. My mistake.
     
  5. macrumors newbie

    Joined:
    Jul 17, 2008
    #5
    Thanks for figuring this out. I just ran across the same thing and was about (with great trepidation) to try what you did.

    Thanks for your courage

    Cheers
    Neal
     
  6. macrumors newbie

    Joined:
    Jun 8, 2008
    #6
    If you restore on iTunes when you do this, does everythign get erased from your phone? Also, if you restore into development mode, can you still dl and use other apps from the iTunes store?

    thanks
     
  7. macrumors newbie

    richard.puckett

    Joined:
    Jul 15, 2008
    Location:
    Seattle, WA
    #7
    You can instruct iTunes to back up your device before "restoring". After you're up to date you can continue using your phone as a regular device.
     
  8. macrumors newbie

    Joined:
    Aug 18, 2008
    #8
    Hi shadowband,

    I did follow the steps you described to get the current version of my iPhone (2.0.1. Build 5B108) using iTunes’ backup/restore option. Unzipped the ipsw file and extracted the 3 *.dmg files (018-3881-4.dmg 24K, 018-3884-4.dmg 200K, 018-3885-4.dmg 18K) Not sure which one to choose, hence randomly chose 018-3885-4.dmg, renamed it as DeveloperDiskimage.dmg and copied it to the appropriate folder. XCode started fine, except threw me an error 0xE8000001 while attempting to upload the application I wrote to the phone!

    Could you explain how you made it to work in your environment?
     
  9. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #9
    As far as I am aware this is old news.
     
  10. macrumors newbie

    Joined:
    Aug 18, 2008
    #10
    mmm… in that case I may have to wait till I get the approval from Apple; enrolled 2 weeks ago for that $99 package, no reply so far…
     
  11. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #11
    Well you need to be fully paid up to deploy programs on the iPhone hardware anyway. Nothing has changed there. All that has changed is you no longer need to download a disk image from the Apple website in order to activate development mode on your iPhone. Just copy across the provisioning profile in Xcode as described in the documentation.
     
  12. macrumors newbie

    Joined:
    Aug 18, 2008
    #12
    Thanks for the clarification. BTW, Where is that "provisioning profile" installed in the Xcode path? Why can't I use it right now if nothing needs to be downloaded?
     
  13. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #13
    You should be able too. Have you followed the instructions provided to the letter? It is very easy to make a mistake and it can bugger you up. I recommend going over the instructions again and making sure you did everything correctly.
     
  14. macrumors newbie

    Joined:
    Aug 18, 2008
    #14
    I went through the instructions several times, All steps succeeded very nicely except this one step where it says "1. Download the OS X iPhone Disk Image (.dmg) from the iPhone Dev Center for the Apple device you are using." under the heading "Installing OS X iPhone". And thats why I have to resort to extracting the .dmg file from the ipsw file manually!
     
  15. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #15
    Skip that step. It relates to when the iPhone OS was in beta and is no longer necessary. At least that is what I was told when I asked the same question here :).
     
  16. macrumors newbie

    Joined:
    Aug 12, 2008
    Location:
    Somewhere in the USA....
    #16
    I'm still confused.

    im still confused. i cant find the OS X iPhone Disk Image (.dmg). Where do I download it?
     
  17. macrumors newbie

    Joined:
    Aug 18, 2008
    #17
    Skipped that step, backed up and restored the phone (and hijacked the *.ipsw file that iTunes backed up in that process), renamed the ipsw to zip and extracted the *.dmg file from it, renamed it to DeveloperDiskImage.dmg, created a folder called DiskImages under the Platforms/iPhoneOS…. and copied it there. Now the Xcode is quiet without popping that annoying dialog ‘diskimage folder not found’, ‘diskimage is not found’ etc., whenever the phone is connected.

    But when I build, as expected (since I am using a G4 environment) one of the build-phase where the code signing is taking place fails! I understand that is because the build script assumes an intel environment instead. I found a way around to fix this but to do that I need that ‘codesign’ file in project/usr/bin folder. Not sure how to generate this file, I thought by assigning the correct provisioning profile in the project’s build settings it should automatically be generated from the certificates that already assigned in keychain! Apparently it is not! Any clues?
     
  18. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #18
    It's downloaded and installed when you update your iPhone / iPod Touch in iTunes. As stated before, you can skip this step; it is a leftover from the pre-2.0-release days.
     
  19. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #19
    Forget the whole ipsw file and the diskimage. It is all sorted now. As long as you have the latest iPhone OS installed from iTunes (2.0.2) it will be fine.
     
  20. macrumors newbie

    Joined:
    Aug 18, 2008
    #20
    Given below is the repost of yet another unhappy iPhone developer who refuses to go for that expensive Intel OS X machines just to push the apps to the device! It looks like he did succeed in his attempt but unfortunately I am stuck in the very beginning: as where did he get this codesign file in his /usr/bin folder (and I am not even sure which ‘usr/bin’ folder he is referring to as there are many such allover the place!). If you could shed some light on it (being a happy Mac developer :)) it will be a great help. Thanks.

    <repost>
    The following was posted on Apple Discussions: Re: iPhone SDK CodeSign Error
    On Wed Jul 30 01:39:44 CDT 2008, Tiku wrote:
    Subject: Re: iPhone SDK CodeSign Error

    The trick seems to be to convert the thin binary into universal binary and then signing it and then returning it back to thin again (although the phone will actually run universal binaries, but thin is a bit smaller). Converting binaries to universal and back with lipo will not break the code signing!

    If you feel adventurous, this is how I managed to get it working:
    mv /usr/bin/codesign /usr/bin/codesign.orig
    Then with you favorite editor create a new /usr/bin/codesign with following contents:
    #!/usr/bin/perl
    #
    $appDir=$ARGV[$#ARGV];
    @tmpAry=split(/\//,$appDir);
    $baseAppName=$tmpAry[$#tmpAry];
    $baseAppName=~s/\.app$//;
    $realAppName="$appDir"."/$baseAppName";

    $sign=0;
    for($b=0;$b<$#ARGV;$b++) {
    if($ARGV[$b] eq "-s") {
    $sign=1;
    }
    }

    $mums=`file $realAppName`;
    if($sign==1 && $mums=~/executable arm/) {
    #print "Signing armv6..\n";
    $dev="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/";
    $tmp="$appDir"."/tmpbin";
    `$dev/lipo -create $realAppName -output $tmp`;
    `mv $tmp $realAppName`;
    system("/usr/bin/codesign.orig",@ARGV);
    `$dev/lipo -thin armv6 $realAppName -output $tmp`;
    `mv $tmp $realAppName`;
    system("rm $appDir"."/CodeResources");
    system("cp $appDir"."/_CodeSignature/CodeResources $appDir"."/CodeResources");
    exit 0;
    } else {
    exec '/usr/bin/codesign.orig',@ARGV;
    }

    Someone with actual perl/sh skills might want to rewrite whole thing :p (and can't figure out how to get identation working, so try to fix them yourself)

    Only mysterious part is the CodeResources symbolic link, it will not upload itself into the device (instant error 0xe8000001, that kept me awake for some time), that's why I've removed it and copied the CodeResources from _CodeSignature.
    </repost>
     
  21. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #21
    There is only one /usr/bin :).
     
  22. macrumors newbie

    Joined:
    Aug 18, 2008
    #22
    There is one in /Developer/user/bin
    and another one in /Developer/Platforms/iPhoneOS.Platform/usr/bin
    and yet another one /Developer/Platforms/iPhoneOS.Platform/Developer/usr/bin
    but none of them has that 'codesign' file he is using in the first move command:

    mv /usr/bin/codesign /usr/bin/codesign.orig :confused:
     
  23. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #23
    /usr/bin is the path - therefore there is only one of them :).

    Take note of the post date. That was all done using the beta SDK. Things could have changed since then.

    Edit : Oh and codesign does exist there.
     
  24. macrumors newbie

    Joined:
    Aug 18, 2008
    #24
    So, the path is from the root! I dont have that in my HD!
    I was trying to upload the snapshot of finder window to a photo-site and provide you with a link but its not working!! but anyway, I only see the following folders in the root:

    Applications
    Developer
    Documentation
    Examples
    Library
    System
    Users

    thats all... and I am running OS X 10.5.4


    Is that a generic file installed during Xcode installation? if so, would you mind emailing me? BTW, my Xcode version 3.1, came along with iPhone SDK package. Should I have to install Xcode separately again?


    Update: Sorry for the trouble, its my ignorance in UNIX file system - used the Terminal app and found that folder and that file. Thanks, will post the out come of the abovementioned adventure
     
  25. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #25
    Well, you obviously need to use the Terminal for this kind of stuff. The Finder hides a huge number of system folders from you. Plus you always have a root folder by definition, it is the root of all other folders. No root folder = unformatted and unpartitioned hard drive.
     

Share This Page