Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Test target of XCUITest seems not to be working after updating to Xcode 10

I updated to xcode 10 from Xcode 9.4 and then when trying to run my UI tests nothing seems to be working. The test app loads for a while then test failed although the build is successfully done before the tests. and the source code builds successfully as well and I can run the app on the simulator.

The error is:

Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying error: The test runner failed to load the test bundle. Executable cannot be loaded for some other reason, such as a problem with a library it depends on or a code signature/entitlements mismatch.))

like image 568
AyaAkl Avatar asked Nov 06 '18 09:11

AyaAkl


2 Answers

First, if you are using Cocoapods make sure your test target has the inherited search paths set up, something like that for instance :

# MARK: Common pods
abstract_target 'AppCommon' do
  pod 'Alamofire'

  target 'MyFrameworkA' do
    project './MyPath/MyFrameworkA/MyFrameworkA.xcodeproj'

    target 'MyFrameworkATests' do
      inherit! :search_paths
    end
  end
end

Next, in your Build phases of your FrameworkA, make sure that any other frameworks (B, C used in A), are set up as target dependencies AND added to the Linked Binary With Libraries.

Finally, make sure your FrameworkATests target have your FrameworkA in Target Dependencies and is added in the Linked Binary With Libraries phase too.

like image 165
jc_35 Avatar answered Nov 16 '22 10:11

jc_35


Xcode 10 introduced new build system which parallelise the most of the building talks including the dependencies. The new build system can detect most of the configuration issues. Must of the projects which has unusual configuration started to fail and new build system has detected this. All things that you should know about build system https://www.xcteq.co.uk/xcblog/five-things-you-must-know-about-xcode-10-new-build-system/

like image 2
Shashi Avatar answered Nov 16 '22 10:11

Shashi