Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 845
Ana Avatar asked Jan 06 '16 22:01

Ana


People also ask

How do I make a release in Xcode?

To create a release build, you have to edit your current scheme (⌘<) and highlight "Run [name of application]. On the right, select "Build Configuration" and choose "Release". Build as usual.

How do I compile framework in Xcode?

In Xcode, select File ▸ New ▸ Project…. Then choose iOS ▸ Framework & Library ▸ Framework. Click Next.

How do I run Xcode in release mode?

Create an Xcode Archive. To test the exact conditions your app user's experience, create a release build. In your Xcode project's scheme editor, set the run destination to a device and adjust the archive task to the Release configuration. Then, choose the Archive option in Xcode's Product menu.


2 Answers

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

enter image description here Alternatively, create a new scheme for release builds.

Ensure you have a device selected. Not the simulator.

enter image description here

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

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

like image 196
Beau Nouvelle Avatar answered Sep 20 '22 09:09

Beau Nouvelle


This works for me:

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

like image 37
Leszek Szary Avatar answered Sep 19 '22 09:09

Leszek Szary