Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode6 code signing required for referenced frameworks?

Xcode 6.1.1

We are trying to sign our app for distribution (or even just to test on physical device). We have a referenced framework in our project. We were under the impression that we should only sign our app itself (and we have all code signing identities, provisioning profiles, etc. set up), but we should not sign this external framework, since we didn't write it. It should be getting its code signing credentials from the parent project.

However every time we try to run on physical device, this referenced framework throws a build error: "CodeSign error: code signing is required for product type 'Framework' in SDK 'iOS 8.1'".

Does this mean we actually have to code sign this?

Specifically, the framework we're trying to use is Alamofire.

like image 403
FloraL Avatar asked Feb 03 '15 01:02

FloraL


People also ask

How do I get an Apple code signing certificate?

Generate a Code Signing Certificate manuallyOpen your Keychain Access app on macOS. Select Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority... Fill in the User's Email Address and the Common Name and select Saved to Disk .

How can I skip code signing for development builds in Xcode?

To turn the code signing off, go to your project and target "Build Settings", search for "Code Signing Identity" change its value to "Don't Code Sign" in both of them. To make this effective you need to change this value in the Project and all of the Targets separately.

What is the purpose of code signing in Xcode?

Code signing your app assures users that it's from a known source and hasn't been modified since it was last signed. Before your app can integrate app services, be installed on a device, or be submitted to the App Store, it must be signed with a certificate issued by Apple.

What is code signature on Mac?

Code signing is a macOS security technology that you use to certify that an app was created by you. Once an app is signed, the system can detect any change to the app—whether the change is introduced accidentally or by malicious code.


1 Answers

I think it depends on where those frameworks come from:

  • If they're yours (i.e. internal library you're bundling with your project), you need to sign them.
  • If they come from an open source project that you're building from source (i.e. a pod from Cocoapods) you'll have to sign them.
  • If they come from a 3rd-party developer they should already be signed.

There's a a step called "Embed Frameworks" under "Build Phases" of the target where you can specify which framework to embed in your bundle and what to code sign:

Embed frameworks build phase

It doesn't matter if they already have a signature: yours will replace whatever was there.

You can always check the certificate status of a framework with the codesign command line tool:

xcrun codesign --verify --verbose [MYFramework.framework/MYFramework]

and print the singing entity with:

xcrun codesign --display --verbose [MYFramework.framework/MYFramework]

like image 57
duhanebel Avatar answered Sep 28 '22 21:09

duhanebel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!