How to build a release version of an iOS framework in Xcode?

Let's say I do the following:

  1. Open Xcode 7
  2. File | New | Project | Cocoa Touch Framework
  3. Create "TestFramework" with the Swift language
  4. Create a file Hello.swift with public func hello() { print("Hello") }.

From here, I can build a debug build of the framework (inside the Debug-iphoneos folder), but I cannot figure out how to build the release version of the framework (inside Release-iphoneos). I thought Archive might do it, but it doesn't. Pointers please?

Answers


To get a release build, you need to change your scheme settings:

Alternatively, create a new scheme for release builds.

Ensure you have a device selected. Not the simulator.

Build your project and you should see that it gets added to this location: (Click the arrow to navigate there in finder)

And after drilling down, you should be able to find the release folder with your release framework inside.


This works for me:

Select your framework target then click Product -> Archive. If organizer window does not pop up after successfull build of your framework then go to "Build Settings" of your framework target, look for option "Skip Install" and change it to "No" (and after that Archive again).


When you add the framework to your other Xcode project then you have to add "$(BUILT_PRODUCTS_DIR)" to Build Settings -> Framework Search Paths. This will create Debug when you run project (with Debug) and will create Release version when you archive project. The archive doesn't will create Release version under Products dir but will create Release in "Intermediates.noindex" folder.


Need Your Help

How to share my Docker-Image without using the Docker-Hub?

docker docker-registry

I'm wondering where Docker's images are exactly stored to in my local host machine.

ADB Android Device Unauthorized

android usb adb device unauthorized

Since I reinstalled Eclipse (simply deleted and downloaded it again) I can't debug my applications on Samsung Galaxy i9001 (with CyanogenMod - Android 4.4.2). It worked fine before reinstallation.