How to export "fat" Cocoa Touch Framework (for Simulator and Device)?

import export business opportunities
export examples
how to export from usa
import and export meaning
how to export imovie
export guide
how to export premiere pro
how to export bookmarks from chrome

With Xcode 6 we get ability to create own Dynamic Cocoa Frameworks.

Because of:

  • Simulator still use 32-bit library

  • beginning June 1, 2015 app updates submitted to the App Store must include 64-bit support and be built with the iOS 8 SDK (developer.apple.com)

We have to make fat library to run project on devices and simulators. i.e. support both 32 and 64 bit in Frameworks.

But I didn't find any manuals, how to export universal fat Framework for future integration with other projects (and share this library with someone).

Here is my steps to reproduce:
  1. Set ONLY_ACTIVE_ARCH=NO in the Build Settings

  2. Add support armv7 armv7s arm64 i386 x86_64 to Architectures (for sure)

  1. Build Framework and open it in Finder:

  1. Add this framework to another project
Actual result:

But in the end I still have problem with running project with this framework on devices and simulator at once.

  • if I take framework from Debug-iphoneos folder - it works on devices and gets error on simulators: ld: symbol(s) not found for architecture i386

    xcrun lipo -info CoreActionSheetPicker
    

    Architectures in the fat file: CoreActionSheetPicker are: armv7 armv7s arm64

  • if I take framework from Debug-iphonesimulator folder - it works on simulators. and I have error on device: ld: symbol(s) not found for architecture arm64

    xcrun lipo -info CoreActionSheetPicker
    

    Architectures in the fat file: CoreActionSheetPicker are: i386 x86_64

So, how to create a dynamic framework that works on devices and simulators?

This answer related to Xcode 6 iOS Creating a Cocoa Touch Framework - Architectures issues but it's not duplicate.


Update:

I found a "dirty hack" for this case. See my answer below. If someone knows more convenient way - please, let me know!

How to Start an Import/Export Business, From importing exotic fashions to exporting light fixtures, the international trade business will take you all over the world and into all product niches. The U.S. Commercial Service has developed comprehensive video collections that will help your small business become better equipped to enter the exciting exporting world. The How To Export series of videos introduces you to the key concepts to get started, when you are ready for more in-depth instruction, step up to the Export Mechanics Training Videos .

How to Export | Exporting Basics Videos | Export.gov, Do you want to expand your US business's presence internationally? Take advantage of the many resources to help you export to foreign markets today! Import/export management companies use two basic methods to price their services: commission and retainer. Normally, you choose one method or the other based on how salable you feel the product is

@Stainlav answer was very helpful but what I did instead was to compile two versions of the framework (one for the device and one for simulator) and then added the following Run Script Phase to automatically copy the precompiled framework required for the running architecture

echo "Copying frameworks for architecture: $CURRENT_ARCH"
if [ "${CURRENT_ARCH}" = "x86_64" ] || [ "${CURRENT_ARCH}" = "i386" ]; then
  cp -af "${SRCROOT}/Frameworks/Simulator/." "${SRCROOT}/Frameworks/Active"
else
  cp -af "${SRCROOT}/Frameworks/Device/." "${SRCROOT}/Frameworks/Active"
fi

This way I don't have use lipo to create a fat framework neither the Realm's strip-frameworks.sh to remove the unnecessary slices when submitting to the App Store.

10 steps to successful exporting, Ten steps to successful exporting. 1. Decide where to sell. Research is vital! Identify the markets with a little desk research. Find the consumption / import figures  Exporting Basics. Most exporting from the United States requires minimal paperwork, and 95 percent of all items exported to a foreign buyer do not require an export license. Learn more from the Basic Guide to Exporting and the U.S. Customs and Border Protection.

How to Export, HOW TO EXPORT. Introduction. India's Foreign Trade i.e. Exports and Imports are regulated by Foreign Trade Policy notified by Central government in exercise​  The main objective to present "How to Export Guide", is to help Export Import community to understand the practical process of starting a Export Import Business. "How to Export Guide" has been especially designed for start ups, small- and medium-sized enterprises that are considering diversification in Exports.

I just want to update this great answer by @odm. Since Xcode 10, the CURRENT_ARCH variable doesn't reflect the build architecture anymore. So I changed the script to check the platform instead:

echo "Copying frameworks for platform: $PLATFORM_NAME"
rm -R "${SRCROOT}/Frameworks/Active"
if [ "${PLATFORM_NAME}" = "iphonesimulator" ]; then
    cp -af "${SRCROOT}/Frameworks/Simulator/." "${SRCROOT}/Frameworks/Active"
else
    cp -af "${SRCROOT}/Frameworks/Device/." "${SRCROOT}/Frameworks/Active"
fi

I also added a line to clear the target directory before copying, because I noticed that additional files in subdirectories wouldn't be overwritten otherwise.

How to Export Your Products to the United States, How to Export Your Products to the United States. These five steps can help your company break into the world's largest economy. Choose the Export command to export an Access table, report, or query to Excel. Just choose the appropriate command and then use the dialog box that Access displays to specify where the exported information should be placed. Exporting to a text file

Importing and Exporting, Learn how to start importing or exporting. On This Page. Importing and Exporting Basics; Obtain an Import License or Permit; Get an Export  Export default. In practice, there are mainly two kinds of modules. Modules that contain a library, pack of functions, like say.js above.; Modules that declare a single entity, e.g. a module user.js exports only class User.

HOW TO EXPORT IMPORT.COM, The information provided here is part of Export Import Online Tutorial Who is benefited by this web blog, www.howtoexportimport.com 1. Any one who is  Export definition is - to carry away : remove. How to use export in a sentence.

For Beginners, Amended Computer based Exam date for Customs Brokers Licencing Computer based examination under regulation 6 of the customs brokers licensing  Share your created movie. To export a sequence as an H.264 file (the most popular option), make sure the Timeline panel is active and choose File > Export > Media or press In the Export Settings dialog box, choose Format: H.264 and Preset: Match Source – High Bitrate. To choose a filename and

Comments
  • duplicate issue stackoverflow.com/questions/24039470/…
  • @AndriusSteponavičius this questions was asked 2 months earlier.
  • Yes, but there are much more detailed answers there, that I think users should know about
  • Set ONLY_ACTIVE_ARCH=NO in the Build Settings is an important step.
  • your framework needs both i386 x86_64 slices in the fat binary if you want to run it on the simulator EVEN IF YOUR COMPUTER HAS A 64 BIT ARCHITECTURE!!! Learnt that the hard way.
  • I used lipo but when framework is building in simulator it's showing unresolved identifier with class name but in device it works. If use simulator version of binary then it's working ..any idea?
  • I haven't found any evidence this has changed by Xcode 8.2 in December 2016. :/
  • @Geoffrey, has this changed in Xcode 9.2 or is anything different? This is my first time creating a binary framework for distribution, and I'm already scared...
  • Haven't done this in a bit, sadly -- can't say. Good luck.
  • I thought Apple doesn't accept fat binaries anymore. kodmunki.wordpress.com/2015/03/04/…