title: Connecting external framework to UI unit testing target, iOS
body: <p>So, i have already existing project at my hands and i’m trying to create some UI tests by using this new fancy UI Testing Bundle provided by apple. The problem is that test target doesn't have access to any external framework (and i need to do some setup with one of them).  Adding framework in build phases and coping framework search path from main target doesn't do anything.</p>
  
  <p>After day of browsing i found out only one thing, that ”makes things kinda different”. By setting up Bundle Loader and Test Host to <strong>$(BUILT_PRODUCTS_DIR)/App.app/App</strong> , i still couldn't import external frameworks to test.m, but i could import classes that do that for them self. And it all would be fine and dandy unless it didn't break some stuff. By setting Bundle and Host now my UI test is unable to execute launch method:</p>
  
  <pre><code>[[[XCUIApplication alloc] init] launch];
  </code></pre>
  
  <p>It crashes with error: <strong>Assertion Failure: UI Testing Failure - App state is still not terminated.</strong></p>
  
  <p>In the end i could remove launch method from setup and trigger every single test manually, so it restarts application every time before executing, but this solution seems so wrong (especially for some bigger projects). Does anyone know proper way to handle this problem?</p>