Disable uitests for ios, do unittests only

i cant find a way to run unittests only. i know its possible via xcode commandline.

can anybody point me into the right direction?


1 Like

Hi @finekost,

Thanks for asking this here!

Can you share the related xcodebuild parameter? As far as I know there is no parameter for this; whether the UI tests are executed depends on your Scheme’s configuration. You can enable and disable tests for schemes, so you can e.g. have a Scheme with only UI and another one with only Unit tests enabled, or you can also run just parts of the test suite. And of course you can set the Scheme on bitrise.io, for every Xcode step separately if you want to.

If there’s a command line option to disable UI/unit tests please let us know, we’d be definitely interested in adding it to the Xcode Test step as an option!

hi there,
i suppose you are right / this was bad worded by me. sorry!
thanks for pointing out “scheme” this should do.

there is a way for running individual test, but you need a script to loop / split them up.
we did this + fastlane for a rather large project where uitests got flaky.

thanks again.

1 Like

You’re right and thanks for the link! It also includes screenshots about what I mentioned, enabling and disabling tests for a specific scheme (https://stackoverflow.com/a/35184012/974381)

Nowadays, it appears the best way to do this is to set up Test Plans, as explained here. Then, to run just the Test Plan containing your unit tests via the command line, see this article.