Debugging iPhone Code Signing

Code signing on the iPhone can be frustrating, and it gets even more frustrating when trying to submit an app to the App Store.

There are two forms of builds, deployment and distribution. You can use the codesign tool from Xcode to verify the signature in your app bundle to ensure they’re signed correctly. The part that is bolded is which certificate was used to sign the app.

abansodmbp:~ abansod$ codesign -dvvvv
Format=bundle with Mach-O thin (armv6)
CodeDirectory v=20001 size=43398 flags=0x0(none) hashes=2161+5 location=embedded
Signature size=4283
Authority=iPhone Developer: Aditya Bansod
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
Signed Time=Nov 13, 2009 4:10:59 PM
Info.plist entries=19
Sealed Resources rules=5 files=7
Internal requirements count=0 size=12

In the above example you can see that it’s signed with my Developer cert. If the app isn’t signed with a developer cert it won’t run on your device. The same thing applies if you’re deploying to the app store. In that case, your app needs to be signed with your Deployment certificate, and you can use the same codesign tool to validate it’s signed with the correct cert.