3

I have couple of queries on frameworks:

  • What is the difference between Debug and Release framework?
  • Is provisioning profile required when creating release framework?
  • Can we use Debug framework in archiving distribution ipa?

Thank you.

Batman4Ever
  • 189
  • 2
  • 11
  • 1
    1.) Release has less debug symbols. 2.) For distributing, I don't think so. Apps that use the framework do have to code sign it. 3.) Yes, but may be slightly slower. – hola Mar 23 '17 at 09:49
  • 1. You can have a look here: [Xcode / Cocoa : What are the differences between debug and release builds?](http://stackoverflow.com/a/761676/3687801) – nayem Mar 23 '17 at 10:27

2 Answers2

2
  1. Difference between debug build and release builds are that debug builds build debug info also, so the debug build might be slower and the built product's size may be larger. See this. Also, if you build with release, debugging is much more harder. Released are compiled with optimisation turned on for gcc, see this for more about release optimisation.
  2. Frameworks don't need to be codesigned, Xcode takes care of it when you add a framework to your project. Just remember to check the "code sign on copy" next to the framework in the "embed framework" section of your project.
  3. Why not? But I would recommend using release framework, it is faster. Harder to debug what happened if framework has bugs if you use release though.
Community
  • 1
  • 1
Papershine
  • 4,995
  • 2
  • 24
  • 48
  • I think the 3. is not correct, dynamic framework that embedded debug (universal framework) need to be stripped off the debug part in order to get app approved, example is Realm dynamic framework, there's a .sh file to strip that debug part off the framework, so i guess it applied to the single debug framework too – Tj3n Mar 23 '17 at 10:04
  • @Tj3n Are you talking about [this](http://www.openradar.me/radar?id=6409498411401216)? It doesn't seem it is about debug, it's about http://stackoverflow.com/questions/38526399/ios-frameworks-with-x86-slice-for-simulator-appstore-approval. – Papershine Mar 23 '17 at 10:10
  • yeah, i think the Debug framework the OP mention is simulator, since he said about Release framework also, while there's only simulator and device build – Tj3n Mar 23 '17 at 10:26
  • @paper1111 Thank you for the answer, up voted. will take some time to accept. – Batman4Ever Mar 23 '17 at 10:29
  • 2 is wrong, Xcode takes care of codesigning for you if you let it. But that doesn't mean frameworks don't need codesigning. If you need to manually copy your framework, you have to codesign it manually too (stated here: https://developer.apple.com/library/content/qa/qa1936/_index.html) – batu Mar 23 '17 at 10:44
  • @batu but in your answer you mentioned provisioning profile is not required, i am confused. – Batman4Ever Mar 23 '17 at 10:51
  • @Batman4Ever You don't need a provisioning profile to codesign a framework. A codesigning identity is all you need to codesign a framework target. So : 1. You don't need a provisioning profile 2. But you still need to codesign framework. – batu Mar 23 '17 at 10:56
  • @batu http://stackoverflow.com/questions/30963294/creating-ios-osx-frameworks-is-it-necessary-to-codesign-them-before-distributin – Papershine Mar 23 '17 at 11:01
  • @paper1111 Which part should I look? :) – batu Mar 23 '17 at 11:03
  • @batu "For OSX framework: Developer is free to distribute OSX framework without codesigning it as Consumer will re-codesign it anyway. For iOS framework: Developer is free to distribute iOS framework without codesigning it as Consumer will re-codesign it anyway, but Developer is forced by Xcode to codesign their framework when they build for iOS device." – Papershine Mar 23 '17 at 11:05
  • @batu also http://stackoverflow.com/questions/29836356/ios8-dynamic-frameworks-codesign-error-code-signing-is-required-for-product second answer – Papershine Mar 23 '17 at 11:08
  • @paper1111 To clarify: yes, you can send unsigned framework to others. But if they are to use that framework in an application, they need to codesign it themselves. That's what I've said in my answer below: "Frameworks require codesigning if they are to be embedded in an application.". So, I think they support my answer. – batu Mar 23 '17 at 11:10
  • @batu OP was asking wether provisioning profile is required, and of course the framework will be codesigned by the consumer if he wants to submit the app, so it is no needed – Papershine Mar 23 '17 at 11:15
1
  • Debug builds generally include x86_64 and i386 architectures along with standard device architectures such as armv7 and arm64. x86_64 and i386 are required for simulator, but it's not used on actual devices. Release builds should remove those architectures to save space.
  • Debug builds include debug symbols in the binary (Build Settings -> Strip Debug Symbols During Copy is generally NO) . Release builds generally don't. They come with dSYM files which help to symbolicate crashes. This saves space too.
  • Debug builds are probably not optimized (build settings -> optimization level is none). Therefore they might perform worse than release builds.
  • Frameworks require codesigning if they are to be embedded in an application. Debug-release builds do not change that. Xcodes codesigns them for you if you check "Code Sign On Copy" checkbox in your application's Build Phases -> Embed Frameworks.
  • Provisioning profile is not required for frameworks.

So, you can use debug builds but it's not recommended.

batu
  • 645
  • 3
  • 10