Xcodebuild: error: '/App.xcworkspace' does not exist

I’m trying to run some simple unit tests for my app. I have configured the Xcode: Unit test step, but it fails, and I can see this in the log:
xcodebuild: error: '/App.xcworkspace' does not exist.
This file should be created in the previous step, which is “Run CocoaPods install”, but apparently it’s not there. Normally I have it in .gitignore but just for test I have commited it to the repo, but the error persists. Anyway, the xcworkspace should be createdy by pod install, but it’s not, so I think the problem might be somewhere there. But the log says it’s successful:

-> Pod installation complete! There are 20 dependencies from the Podfile and 26 total pods installed.
Success!

The general log says this:

xcode test exit code: 66
xcode test failed, error: exit status 66

Ideas?

Starting a path with / means absolute path. E.g. the Absolute path of Xcode.app is /Applications/Xcode.app.

To use a relative path you should start with ./ or with no / at all (e.g. App.xcworkspace or sub/dir/App.xcworkspace).

Alternatively you can also reference the source code dir, with $BITRISE_SOURCE_DIR, so e.g. $BITRISE_SOURCE_DIR/App.xcworkspace should also work.

Ok, so where do I configure this? I have pretty much a stock version of the Xcode: Unit test step, so should I configure it somewhere there? To be honest, I’m not sure where the \ comes from on the first place.

I’d say you most likely specified that during the Add New App process -> did you select the “manual” option, where you have to type in these parameters (instead of selecting from a pre-defined list the scanner provides)?

In any case, you can change this either directly in the Xcode steps, or, to change it only at one place, under App Env Vars. The scanner generates an app env var for these configs, should be BITRISE_PROJECT_PATH. Don’t change the key, only the value :wink:

Found it, thank you very much for your help.

1 Like

Any time :wink: