Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Do Not Embed", "Embed & Sign", "Embed Without Signing". What are they?. What they do?

We have 3 new options in "Frameworks, Libraries, and Embedded Content" section of Xcode11 Beta for adding libraries.

Xcode Libraries section screenshot

enter image description here

Can anyone explain what they do?

like image 290
Shreeram Bhat Avatar asked Aug 28 '19 07:08

Shreeram Bhat


People also ask

Do not Embed vs Embed Without Signing?

Do Not Embed option is basically Linking given . framework into project. Embed & Sign and Embed Without Signing is old Embedding option.

Should Xcframework be embedded?

While debugging in the simulator, Xcode would load all frameworks needed even if they're set as "Do Not Embed". However, if you directly run app or debug in the real device, "image not load" would occur for those frameworks set as "Do Not Embed". So, we should embed all third-party frameworks I think.

What is difference between static and dynamic framework?

Static and Dynamic Frameworks:Static frameworks contain a static library packaged with its resources. Dynamic frameworks contain the static/dynamic library with its resources. In addition to that, dynamic frameworks may conveniently include different versions of the same dynamic library in the same framework.


2 Answers

As already stated by @przemyslaw-jablonski, this is similar to what was in XCode 10, but in only one screen (which I personally like!).


Embedding

Do not embed static frameworks and libraries (linking happens at build time), only shared ones (dynamic linking happens at run time, so they need to be in your bundle).

file frameworkToLink.framework/frameworkToLink will return:

  • current ar archive: static library, select Do not embed
  • Mach-O dynamically linked: shared library, select Embed

Signing (only if shared/embedded)

Not required if it already has a proper signature (adhoc doesn't count).

codesign -dv frameworkToLink.framework will return:

  • code object is not signed at all or adhoc: select Embed and sign
  • anything else: already properly signed, select Embed Without Signing
like image 151
agirault Avatar answered Sep 21 '22 12:09

agirault


Basically in Xcode 10 in project settings (upon clicking on .xcodeproj file, with the blue icon) you had two framework-oriented sections visible - Embedded Binaries and Linked Frameworks and Libraries. Now they are merged into one.

Do Not Embed option is basically Linking given .framework into project.

Embed & Sign and Embed Without Signing is old Embedding option.

I am not entirely sure what is the functional difference between the last two, apart from the fact that framework will or will not be signed during assembly. If you want to know the difference between Linking and Embedding then here you can find SO answer on this.

Pics:

Xcode 10

Xcode 11

like image 36
Przemyslaw Jablonski Avatar answered Sep 21 '22 12:09

Przemyslaw Jablonski