PDA

View Full Version : iOS Packaging failing - Code Signing issue



vikramiyer
20 Sep 2012, 1:55 AM
I have Sencha SDK tools Beta 3 installed on my Mac with valid certificates, app id's and provisioning done.




[INFO] Generated app.json
[INFO] Embedded microloader into index.html
[INFO] Packaging your application as a native app...
[INFO] The application was successfully packaged
Failed to execute system command while signing application with error 256
Failed to package application
[ERROR] /Users/Vzee/NodeSencha/public/SampleApp/build/native//SampleApp.app: object file format unrecognized, invalid, or unsuitable




Seems to be a code-signing issue. How do I get past this issue?




export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/usr/bin/codesign_allocate"


I even set this. Doesn't seem to have an impact.

vikramiyer
20 Sep 2012, 5:53 AM
Atleast I am able to make some headway




[INFO] Packaging your application as a native app...
[INFO] The application was successfully packaged
The application was successfuly signed
Only iOS simulator is supported to run packaged apps
Failed to run packaged application



I don't get any errors now. The Entitlements Certificate had an error in the prefixed (.) in the App ID string. I get the above now.

However the application still doesn't install

vikramiyer
21 Sep 2012, 4:37 AM
Atleast I am able to make some headway




[INFO] Packaging your application as a native app...
[INFO] The application was successfully packaged
The application was successfuly signed
Only iOS simulator is supported to run packaged apps
Failed to run packaged application



I don't get any errors now. The Entitlements Certificate had an error in the prefixed (.) in the App ID string. I get the above now.

However the application still doesn't install




Finally I was able to install the application onto my iPad.Below are the sequence of steps that I did to get it working.

I dragged the SampleApp.app into the organizer window in Xcode in Applications. The console window gave the list of errors. I found that this was the error.

The executable was signed with invalid entitlements.
Entitlements was getting screwed up though the application was signed properly.

I issued this command eventually

codesign -f -dvvv -s "iPhone Developer" SampleApp.app

SampleApp.app: replacing existing signature
SampleApp.app: signed bundle with Mach-O universal (armv6 armv7) [com.xxxxx.xxxx]

Now I was able to drag the application into my iPad and it installs

abcd_ca
26 Nov 2012, 3:27 PM
@vikramiyer's solution worked for me too eventually. Too slow to be practical in my workflow though, I'll probably have to use phonegap for now but will follow Sencha CMD closely 'cause I'm so close to having it work properly (works great in simulator) and I think it might be more convenient than phonegap for simple projects that don't need to integrate with 3rd party obj-c frameworks / xcode projects.

abcd_ca
26 Nov 2012, 4:13 PM
Turns out though xcode can automate the device provisioning and stuff, when I looked in the iphone dev provisioning portal there was in fact a mismatch with the provisioning profile so I created another profile and removed old ones and it's now working for my iPhone 5 just not my iPhone 3Gs for some reason. I'll debug that later, maybe another mismatch I overlooked.

I suspect the reason @vikramiyer' codesigning solution worked is that xcode is possibly a little smarter than sencha cmd at guessing which profile to use or something like that.