Embedding framework in iOS generates an error when signing

Viewed 259

I am currently trying to embed the Azure client framework into an iOS project, but the build is failing when it tries to sign the framework, with the following error:

~/Library/Developer/Xcode/DerivedData/MyProject-gtoxtgdnkyheledfgmjhogvasnql/Build/Products/Debug-iphonesimulator/MyProject.app/Frameworks/AZSClient.framework: bundle format unrecognized, invalid, or unsuitable

After poking around on the web, I found this highly useful page: https://github.com/mattgallagher/CwlSignal/issues/16

The command being run by code sign is this:

/usr/bin/codesign --force --sign - --timestamp=none \
    --preserve-metadata=identifier,entitlements,flags \
    ~/Library/Developer/Xcode/DerivedData/MyProject-gtoxtgdnkyheledfgmjhogvasnql/Build/Products/Debug-iphonesimulator/MyProject.app/Frameworks/AZSClient.framework

which generates the error I mentioned above. Following Mat's lead and modifying the end of the command to point to the actual framework binary as follows:

/usr/bin/codesign --force --sign - --timestamp=none \
    --preserve-metadata=identifier,entitlements,flags \
    ~/Library/Developer/Xcode/DerivedData/MyProject-gtoxtgdnkyheledfgmjhogvasnql/Build/Products/Debug-iphonesimulator/MyProject.app/Frameworks/AZSClient.framework/AZSClient

the command correctly executes and signs the framework.

My Question: How do I modify the Xcode build system to do this. If I try just building after running the code sign on the command line, it overwrites my code sign. If I try building without signing the framework, it presents an unsigned version of the framework to the target (in this case the simulator).

0 Answers
Related