Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run a single unit test method in xcode without rebuilding?

Tags:

xcode

ios

How do I run a single unit test method in xcode without rebuilding? Every time I press the diamond xcode rebuilds. How can I fix this so that I can simply re-run the test without rebuilding?

like image 599
Andrew Paul Simmons Avatar asked Sep 05 '25 07:09

Andrew Paul Simmons


1 Answers

Not sure if previous versions had this option, but Xcode 13 allows running a single test without rebuilding by accessing the context menu for that particular test.

You can access the context menu via right click, or cmd+click on the diamond corresponding to the test:

enter image description here


If your last test action was to run the test you're interested into, you can also re-launch the test via the Product->Perform Action menu:

enter image description here

Too bad the menu doesn't come with a default key binding, however one is not hard to set, just go to Preferences->Key Bindings:

enter image description here

This way, you can keep editing the production code, and use the keyboard to keep relaunching the same test as long as needed.

like image 156
Cristik Avatar answered Sep 08 '25 00:09

Cristik