title: iOS Swift/Obj-C Framework, Test Target doesn't load Swift Runtime
body: <p>I have an app target consisting of four self written frameworks. Each of this frameworks consists out of Swift as well as Obj-C code. So far so good.</p>
  
  <p>Currently only the application target has the build option "Embedded Content Contains Swift Code" set to yes. Therefore the frameworks test targets fail to run with the following error</p>
  
  <pre><code>The test bundle at
  /Users/user/Library/Developer/Xcode/DerivedData/SomeProject
  gbkzuhubemghuoeuebqsuphggisv/Build/Products/Debug-
  iphonesimulator/SomeFrameworkTests.xctest could not be loaded because an
  unanticipated error occurred.
  2015-07-10 15:36:55.402 xctest[24678:1813940] Detailed error 
  information: Error Domain=NSCocoaErrorDomain Code=3587 "The bundle 
  “SomeFrameworkTests” couldn’t be loaded because it is damaged or missing 
  necessary resources." 
  (dlopen_preflight(/Users/user/Library/Developer/Xcode/DerivedData/SomeProject-
  gbkzuhubemghuoeuebqsuphggisv/Build/Products/Debug-
  iphonesimulator/SomeFrameworkTests.xctest/SomeFrameworkTests): Library not loaded: 
  @rpath/libswiftCore.dylib
  </code></pre>
  
  <p>I can fix this by setting the build option "Embedded Content Contains Swift Code" for all frameworks to yes. But in this case I include the swift runtime five times in the final ipa. This means a size increase of more than 100% (14mb vs. 6mb - with the runtime only included once).</p>
  
  <p>Enabling the build option "Embedded Content Contains Swift Code" only for the frameworks test target does not fix the problem. Sigh.</p>
  
  <p>Do you have any idea on how to run the test targets with embedded Swift Runtime, but not compile the Runtime into the Release Build?</p>