facebookarchive / xctool

An extension for Apple's xcodebuild that makes it easier to test iOS and macOS apps.
Apache License 2.0
6.91k stars 738 forks source link

Failed to install the test host app #713

Closed DNCGraef closed 8 years ago

DNCGraef commented 8 years ago

Hi,

I am invoking xctool in the following way:

xctool test -newSimulatorInstance -IDEBuildOperationMaxNumberOfConcurrentCompileTasks=4 -project ./MyApp/MyApp.xcodeproj -configuration Debug -scheme MyApp -sdk iphonesimulator -destination "platform=iOS Simulator,id=7CDBF3DF-9B3E-4A93-A1F1-B7536B283A77" -launch-timeout 300

The tests build and run successfully on my machine (Late 2013 MacBook Pro Retina, OSX 10.11.6, 2.6Ghz i5, 8Gb RAM). However on the Mac Mini that I'm using for CI (Late 2012 Mac Mini, OSX 10.11.6, 2.5Ghz i5, 4Gb RAM), the following problem is manifesting (after a successful build-tests phase). Note that this is when run directly on the box via VNC, not through any kind of CI medium:

[Info] Collecting info for testables... (17515 ms) run-test MyAppTests.xctest (iphonesimulator9.3, On Demand Test Simulator, application-test) [Info] Prepared 'On Demand Test Simulator' simulator to run tests. (1930 ms) [Warning] Failed to install the test host app 'uk.co.mycompany.myapp'. (30002 ms) [Info] Preparing test environment failed; will retry 2 more times (0 ms) [Info] Verified iOS Simulators... (0 ms) [Info] Shut down iOS Simulator... (11091 ms) [Info] Stopped any existing iOS simulator jobs to get a fresh simulator. (777 ms) [Info] Reset iOS simulator content and settings at path "/Users/MyUser/Library/Developer/CoreSimulator/Devices/7CDBF3DF-9B3E-4A93-A1F1-B7536B283A77/data" (975 ms) [Info] Prepared 'On Demand Test Simulator' simulator to run tests. (461 ms) [Info] Prepared 'On Demand Test Simulator' simulator to run tests. (30 ms) [Warning] Failed to install the test host app 'uk.co.mycompany.myapp'. (30002 ms) [Info] Preparing test environment failed; will retry 1 more time (0 ms) [Info] Verified iOS Simulators... (0 ms) [Info] Shut down iOS Simulator... (11055 ms) [Info] Stopped any existing iOS simulator jobs to get a fresh simulator. (127 ms) [Info] Reset iOS simulator content and settings at path "/Users/MyUser/Library/Developer/CoreSimulator/Devices/7CDBF3DF-9B3E-4A93-A1F1-B7536B283A77/data" (801 ms) [Info] Prepared 'On Demand Test Simulator' simulator to run tests. (225 ms) [Info] Prepared 'On Demand Test Simulator' simulator to run tests. (23 ms) [Warning] Failed to install the test host app 'uk.co.mycompany.myapp'. (30002 ms) [Warning] Preparing test environment failed. (0 ms) -[TEST_BUNDLE FAILED_TO_START]

Any idea what might be causing this? I can't identify any real differences in the way the machines are set up (other than discrepancy in hardware). Note that I've had "xcodebuild test" working successfully on both machines. Additionally, it's not clear to me where -launch-timeout has an effect as the "failed to install test host app" stage still times out after 30s?

ExtremeMan commented 8 years ago

Sorry, we have never had a chance to look into this issue. Can you please try version 0.3 (should be soon available via homebrew) and open a new issue if you still see a problem with xctool? Thanks!