Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

shadowband

macrumors member
Original poster
Jan 10, 2004
31
0
massachusetts
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.
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
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.

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.
 

shadowband

macrumors member
Original poster
Jan 10, 2004
31
0
massachusetts
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.
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
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.

Ah, sorry thought you meant the SDK. My mistake.
 

nealgoldstein

macrumors newbie
Jul 17, 2008
1
0
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
 

bkphat

macrumors newbie
Jun 8, 2008
17
0
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
 

Forever Knight

macrumors newbie
Aug 18, 2008
12
0
A local iPhone disk image is required to "restore" the iPhone into a development platform, and item 2 (above) resolves this issue.

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?
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
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…

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.
 

Forever Knight

macrumors newbie
Aug 18, 2008
12
0
Just copy across the provisioning profile in Xcode as described in the documentation.

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?
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
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?

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.
 

Forever Knight

macrumors newbie
Aug 18, 2008
12
0
Have you followed the instructions provided to the letter?

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!
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
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!

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

Forever Knight

macrumors newbie
Aug 18, 2008
12
0
Skip that step.

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?
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
im still confused. i cant find the OS X iPhone Disk Image (.dmg). Where do I download it?
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.
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
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.

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.
 

Forever Knight

macrumors newbie
Aug 18, 2008
12
0
As long as you have the latest iPhone OS installed from iTunes (2.0.2) it will be fine.

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>
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
Given below is the repost of yet another unhappy iPhone developer who refuses to go for that expensive Intel Mac 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.

There is only one /usr/bin :).
 

Forever Knight

macrumors newbie
Aug 18, 2008
12
0
There is only one /usr/bin :).

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:
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
/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.
 

Forever Knight

macrumors newbie
Aug 18, 2008
12
0
/usr/bin is the path

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


codesign does exist there.
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.