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?
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:
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:
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:
This way, you can keep editing the production code, and use the keyboard to keep relaunching the same test as long as needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With