title: How to export "fat" Cocoa Touch Framework (for Simulator and Device)?
body: <p>With <strong>Xcode 6</strong> we get ability to create own Dynamic <code>Cocoa Frameworks</code>.</p>
  <p><img src="https://i.stack.imgur.com/AmsPU.png" alt="enter image description here" /></p>
  <p>Because of:</p>
  <ul>
  <li><p>Simulator still use <code>32-bit</code> library</p>
  </li>
  <li>
  <blockquote>
  <p>beginning June 1, 2015 app updates submitted to the App Store must include 64-bit support and be built with the iOS 8 SDK (<a href="https://developer.apple.com/news/?id=04082015a" rel="noreferrer">developer.apple.com</a>)</p>
  </blockquote>
  </li>
  </ul>
  <p>We have to make fat library to run project on devices and simulators. i.e. support both 32 and 64 bit in Frameworks.</p>
  <p>But I didn't find any manuals, how to <strong>export</strong> universal fat Framework for future integration with other projects (and share this library with someone).</p>
  <h2>Here is my steps to reproduce:</h2>
  <ol>
  <li><p>Set <code>ONLY_ACTIVE_ARCH=NO</code> in the <code>Build Settings</code></p>
  <p><img src="https://i.stack.imgur.com/jwhDR.png" alt="enter image description here" /></p>
  </li>
  <li><p>Add support <code>armv7 armv7s arm64 i386 x86_64</code> to <code>Architectures</code> (for sure)</p>
  </li>
  </ol>
  <p><img src="https://i.stack.imgur.com/nyFxb.png" alt="enter image description here" /></p>
  <ol start="3">
  <li>Build Framework and open it in Finder:</li>
  </ol>
  <p><img src="https://i.stack.imgur.com/a4fiG.png" alt="enter image description here" />
  <img src="https://i.stack.imgur.com/uVL6V.png" alt="enter image description here" /></p>
  <ol start="4">
  <li>Add this framework to another project</li>
  </ol>
  <h2>Actual result:</h2>
  <p>But in the end I still have problem with running project with this framework on devices and simulator at once.</p>
  <ul>
  <li><p>if I take framework from <code>Debug-iphoneos</code> folder  - it works on devices
  and gets error on simulators: <code>ld: symbol(s) not found for architecture i386</code></p>
  <pre><code>  xcrun lipo -info CoreActionSheetPicker
  </code></pre>
  <blockquote>
  <p>Architectures in the fat file: CoreActionSheetPicker are: armv7 armv7s arm64</p>
  </blockquote>
  </li>
  <li><p>if I take framework from <code>Debug-iphonesimulator</code> folder - it works on simulators. and I have error on device: <code>ld: symbol(s) not found for architecture arm64</code></p>
  <pre><code>  xcrun lipo -info CoreActionSheetPicker
  </code></pre>
  <blockquote>
  <p>Architectures in the fat file: CoreActionSheetPicker are: i386 x86_64</p>
  </blockquote>
  </li>
  </ul>
  <h2>So, how to create a dynamic framework that works on devices and simulators?</h2>
  <p>This answer related to <a href="https://stackoverflow.com/questions/24039470/xcode-6-ios-creating-a-cocoa-touch-framework-architectures-issues">Xcode 6 iOS Creating a Cocoa Touch Framework - Architectures issues</a> but it's not duplicate.</p>
  <hr />
  <h2>Update:</h2>
  <p>I found a &quot;dirty hack&quot; for this case. See my <a href="https://stackoverflow.com/a/29650369/1698467">answer below</a>.
  If someone knows more convenient way - please, let me know!</p>