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

Oct 22, 2008 1:43 AM in response to trapper-

Ok, I think I’ve figured this out. The problem is caused by the scripts alteration of the CodeResources part after the app has already been signed - this breaks the signature.

So I tried commenting out these two lines, and wa-la the upload is accepted. Hopefully everything is fine, but will wait to hear back from Apple and see if everything goes through over the next week or so.

For anyone else having the same problem here’s exactly what I’ve done.

To compile to run on device for testing, leave these two lines as is.
system("rm $appDir"."/CodeResources");
system("cp $appDir"."/_CodeSignature/CodeResources $appDir"."/CodeResources");

To compile to upload to iTunesConnect, comment these two lines out.
#system("rm $appDir"."/CodeResources");
#system("cp $appDir"."/_CodeSignature/CodeResources $appDir"."/CodeResources");

Oct 22, 2008 8:11 PM in response to trapper-

Great news trapper.
I did actually find that commenting those exact lines out of the script suddenly gave me a validated app when doing codesign -vvvv and codesign -dvvv
However it still failed the upload. I did find however that there was a problem with my xcode project file setup, because I had to alter it a little when I used ma borrowed Intel mac to actually sign and upload the app.
I'll be trying to upload my next app this weekend with any luck, so hopefully all will go well with my G5. Woot !!!
I'm also interested in finding a better way of handling this rather than having to comment out and then put back in those two lines. If I come up with a solution, I'll post it here.

Oct 23, 2008 12:39 PM in response to Dev123456

Well, I was able to build the app by modifying the script. I'm still unable to push my app to my phone. I get the following errors in the Organizer log. Should I be using Organizer or iTunes?

Thu Oct 23 15:14:24 unknown afcd[804] <Error>: user mobile has uid 501

Thu Oct 23 15:14:24 unknown afcd[804] <Error>: mode is 0x41e8
Thu Oct 23 15:14:26 unknown mobile installationproxy[806] <Error>: install embeddedprofile: Skipping the installation of the embedded profile
Thu Oct 23 15:14:26 unknown mobile installationproxy[806] <Error>: verify_executable: Could not validate signature: e800800e
Thu Oct 23 15:14:26 unknown mobile installationproxy[806] <Error>: preflight applicationinstall: Could not verify /var/tmp/install_staging.iDfqEm/BubbleLevel.app/BubbleLevel
Thu Oct 23 15:14:26 unknown mobile installationproxy[806] <Error>: install_application: Could not preflight application install
Thu Oct 23 15:14:26 unknown mobile installationproxy[806] <Error>: handle_install: Installation failed

BTW the part I needed to alter was the conditional:

if($sign==1){# && $mums=~/executable arm/) {

I commented the mums component and it seemed to work alright. If I leave that in there then I get the codesign error. Not sure what I'd need to change to leave that component in there.

Oct 23, 2008 3:20 PM in response to iBloggerByDay

Hmm, there wasn't really anything on that Blog that helped.

I've been reading every page I find on Google and this thread is the closest solution I've found thus far. Everyone else seems to have had success with this script and I'm pretty sure I have the script working correctly. The only other ambiguous aspect of this procedure is the Bundle Identifier. No one has posted a concrete example of what you'd want to use with a wild card identifier like ######.* with no company name or application name but rather just the AppID number and a dot asterisk.

Perhaps it's time to just pony up for an Intel Mac but it's just really a bad time right now.

Oct 24, 2008 12:05 PM in response to Jeremy Alessi

Now I've got the BubbleLevel application built. I can drag it into iTunes as well as my provisioning file. However, when I sync my phone I'm told that The application BubbleLevel was not installed on the iPhone because it cannot be verified.

Provisioning files are in place, app was code signed, etc... What could the problem be? I'm using a total wild card ID of .* and I've tried various Bundle Identifiers to no avail.

Oct 27, 2008 5:26 AM in response to brisbanebazza

Did anyone else have to ditch this part of the script?

&& $mums=~/executable arm/)

If I leave that condition in there then my codesign fails. Is this vital? It seems to be just making sure that I'm only doing this if I'm signing an arm executable. If it is vital then perhaps my codesign isn't being executed properly.

Instead I'm using this:

$sign = 0;
for ( $b = 0; $b < $#ARGV ; $b++ )
{
if ( $ARGV[$b] eq "-s" && $ARGV[$b + 1] eq "iPhone" ) # made sure I'm signing with an iPhone cert
{
$sign=1;
}
}

$mums=`file $realAppName`;
if ( ($sign==1) ) # && ($mums=~/executable arm/) ) commented out this mums condition

I'm just using xCode with a "-s iPhone" being passed via "Other Code Signing Flags". Is this the procedure everyone else followed?

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.