How to unit test macOS app using Bitrise?

I would like to use Bitrise to run Unit Tests for a macOS app. The current Unit Test step “Xcode Test for iOS” does not work. Is there a step we can use? Or should we just use the script step?

1 Like

Hi @Peter,

Thanks for asking this question here! :wink:

Did you register the project in the last couple of weeks? I’m asking because we now have a scanner for macOS projects New project scanner which should auto configure a workflow for you if it detects your repo as a macOS project.

If that’s an option it might be the best to register the repo again, and let the bitrise scanner prepare it for you.

If you’d want to do this manually

You can use the Xcode Test for Mac step - but if you registered the repository before the macOS scanner, this step might not be in the default list when you click the “add new step” + icon in the workflow editor.

If that would be the case, you should go to the Settings tab of the app, and change the project type to MacOS in the Project Type Selector

After this you should see the Xcode Test for Mac step in the step list.

An alternative solution is to turn off the Filter by platform option in the step list popup

When this filter is turned off all available steps are listed, but be careful as there might be steps which are not compatible with your macOS project.

If you’d have any questions just let us know!

Thanks! The last step to turn off the “Show only Steps supported by platform?” was hiding this step.

1 Like

Yeah, if you registered your project before the macOS scanner then the app is most likely set as an “iOS” project. I’d suggest you to change that in Settings to MacOS, so that you don’t have to keep disabling the platform filter every time :wink: