Feel free to add your comments to this list.
You can do it directly on GitHub, by clicking this link, just don’t forget to send it as a Pull Request ;)
Performance related ⚓
Note: mainly affects UI tests.
The root cause of the issue is that Xcode / the iOS Simulator has issues in performance limited environments. This included Virtual Machines (which is how your builds are running on bitrise.io), MacBook Airs, Mac Minis with HDD storage, …
It can happen even if you use Apple’s Xcode Bots CI server on non SSD Mac Mini.
- UI Tests fail to start
- One or more UI Test case hangs
Related links & reports:
- XCode bot error: Early unexpected exit, operation never finished bootstrapping
- UI Testing Failure - Failed to launch within 2.5s, Interrupting test
- Assertion Failure: UI Testing Failure - Failed to receive completion for …
- Assertion Failure: UI Testing Failure - Failed to receive completion for XCDeviceEvent: page 12 usage 64 duration 0.01s within 10.0s
- UI Testing Failure - Failed to perform AX action for monitoring the event loop
- UI Testing Failure due to failed AX Action
- Every other test case being skipped - UI Testing Failure - App state for <XCUIApplicationProcess: …> is XCApplicationStateRunningActive (3), still not XCApplicationStateNotRunning
Possible solutions ⚓
- As reported in this StackOverflow answer & in this Apple dev forum discussion
a possible workaround can be to not to store
**XCUIApplication()**in a variable, instead reference / use it directly. E.g. instead of:
let app = XCUIApplication() ; ... ; app.launch()do:
- Others reported that if you add a delay (
sleep(10)) after every
app.launch()related to your tests, it can leave enough time for Xcode / the iOS Simulator to initialize the Accessibility labels, so that UI Tests can properly find the elements by the Accessibility labels. (Related Apple developer forum discussion)
- Related: remove every explicit
- Related: remove every explicit
- Try another Simulator device
- Use the Async testing APIs
- Some users had success with splitting the tests into multiple Schemes, and running those separately, with separate Test Steps.
- A great article about splitting tests into multiple Schemes: http://artsy.github.io/blog/2016/04/06/Testing-Schemes
- Sometimes it’s related to a code which makes Xcode to misbehave
- Try another Xcode version.
Xcode Unit Test fails without any error, with exit code 65 ⚓
This can be caused by a lot of things, Xcode or some other tool simply omits / does not present any error message.
Some possible solutions:
- First of all, if you use
xcprettyto format the output try a build without it (if you use the Xcode Test Step you can set
xcodebuildas the “Output Tool” option/input to not to format the log produced by
xcodebuild). The cause is:
xcprettysometimes omits the error message in it’s output.
- If you don’t use our Xcode Test Step to run your UI Test you should try to run it with our Xcode Test step. We always try to improve the reliability of the step, implementing known workarounds for common issues.
- If you use our Xcode Test Step: make sure you use the latest version, as it might include additional workarounds / fixes.
- Try another Xcode version, there are issues which are present in one Xcode version but not in another one.
- Make sure your desired Xcode scheme is shared. Don’t forget to commit and push the changes if you just enabled it.
- It might also be a project configuration issue in your Xcode project, a code issue in your tests,or a multi-threading issue in your code.
- We received reports that this might also be caused by Code Coverage report generation, you can disable the Generate code coverage files? option of the Xcode Test Step to not to generate Code Coverage files.
Segmentation fault ⚓
The error is:
clang: error: unable to execute command: Segmentation fault: 11
This is usually due to Xcode version mismatch - that you use a different Xcode on your Mac than the one you use on bitrise.io.
The solution is simple, just make sure that you use the same Xcode version everywhere.
Issues which occur with the Xcode Command Line Tools (
xcodebuild), but not with Xcode.app ⚓
xcodebuild hangs when a test causes EXC_BAD_ACCESS kernel exception ⚓
Note: this can happen only on specific iOS Simulators / iOS versions too, e.g. if the app only crashes on iOS 8, but not on iOS 9
Xcode 8 - xcodebuild .. test hangs at the very end of the tests ⚓
xcodebuild .. test hangs at the end of the tests (after it printed the summary of the tests)
if the output of
xcodebuild .. is piped / redirected in any way.
This means that
xcodebuild .. test .. | xcpretty or even
tee can be used to reproduce this issue.
- Related radar and xcpretty issues.
- Workaround: use a Script Step instead of the Xcode Test step, and copy paste the
xcodebuildcommand from the hanging Xcode Test Step’s log, without
| xcprettyetc. Of course, with this you won’t be able to use the built in features the Xcode Test Step provides, but the base
xcodebuildcommand should be able to run, if the output is not redirected / piped.
Every/Any Xcode command hangs ⚓
This is a rare issue, caused by running a non shared Scheme.
xcodebuild can only work with shared Schemes and user schemes (auto created by Xcode.app).
xcodebuild, unlike Xcode.app, does not auto create user schemes, it can only work with
shared schemes and already existing user schemes (Xcode.app creates the user scheme when you open
the project in Xcode.app on the specific Mac machine the first time, for schemes which are not marked as shared).
If you try to run a command on a missing / non shared Scheme it usually manifests in a “scheme not found”
error, but we saw projects where it resulted in
xcodebuild hanging, instead
of an error message.
If this is the case then any
xcodebuild command will hang, even something
as simple as
Build hangs ⚓
Simulator reset ⚓
As reported here, if you do a simulator reset during the build, e.g. with a pre-action Build Phase Script
xcrun simctl erase all, it can cause Xcode / the Simulator to hang.
It might also not be Xcode related, but might be caused by something in your project when it runs in an Xcode Step (Xcode Test, Xcode Archive, …). For example if you have a Run Phase Script in your Xcode project, that will run during Xcode build/test/archive, and that script hangs for some reason (e.g. it waits for a user input).
Check out our guide on frequent iOS issues for more information!
The open source codesigndoc tool runs a clean Xcode/Xamarin Studio Archive on your Mac, and analyzes the generated archive file.
You can easily create a signed IPA for your Xcode project with Bitrise. All you need to do is set the relevant inputs of our Xcode Archive & Export for...
If you have issues with iOS code signing, you need to check your code signing files, your export method, your app's capabilities, and your registered test devices.