Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

iPhone SDK CodeSign Error

I have been using the iPhone SDK and the app. runs on the sim, but it will not allow me to test it on the device. I get an CodeSign Error. How do apply the Developer cert.?

iPhone, Mac OS X (10.5.2)

Posted on Mar 23, 2008 4:20 PM

Reply
64 replies

Apr 2, 2008 8:35 PM in response to Saurabh Garg

Yeah, we have spent the $99 and have been accepted into the program. I have my certs, they're in my keychain, my project is setup seemingly correctly. There's nothing on the iPhone dev site that says, "contact Apple engineers about the beta program", just the generic "contact us" links.

I'm surprised they don't have support forums dedicated to this. I have lots of feedback...who do I email? I was contacted by someone from Apple regarding the beta...do I just send feedback to that person?

As for asking for help...I'm trying this on a PPC Powerbook, so I doubt they'd help anyway since that platform is not "officially" supported. That's why I'm curious if anyone else has had issues with the codesigning build phase of their iPhone projects. I'm just looking for someone to say, "yeah it works fine on my Mac", or "I had the same issue, contact Apple and they'll work through the issue with you". If nobody else has experienced the same issue, I can prolly assume it's a platform problem.

I don't want anyone to divulge anything covered by the NDA...just let me know if I'm alone with my issue or not.

Apr 21, 2008 11:07 AM in response to Paul Dolce

You need to be working on the officially supported platform. Though I cannot say for sure, I'm pretty certain that there are portions of the development and build for the iPhone that are not PowerPC and so will not work on a PowerBook. This is quite likely at least part of the problem you're experiencing. Apple developer support definitely will not help you work out a problem like this when you're not working on the platform they require.

Jul 24, 2008 12:00 AM in response to Paul Dolce

Same issue for me. I've been waiting till the next revision of the MacBook Pros before spending a significant amount on an intel mac, but I still wanted to try developing for the iPhone.

Everything works except for the codesign step. Code compiles, links, works in the simulator, etc.

Anyone know why codesign won't work on PowerPC hardware? I know it isn't officially supported for iPhone development, but I'd still love to be able to play around before I make the move to intel, since that's still a couple months off, at least.

Jul 29, 2008 11:39 PM in response to shinyformica

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.

Aug 4, 2008 5:44 PM in response to Tiku

Tiku i can't get your solution to work, it does actually compile now however. i don't get the "signing" error, but when I try and install it on the phone I get the 0xe8000001 you were referring to at the end of that post.

Reading the last sentence you say:
"that's why I've removed it and copied the CodeResources from _CodeSignature."

I was thinking maybe that is an extra step but you added that into the script there at the bottom so i am guessing it should work. Any hints? You can email me at michael.br.wade@gmail.com or just post here.

iPhone SDK CodeSign Error

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.