Now, when we are talking about Unit Testing in Xcode, the first and the most obvious shortcut is CMD+U
(⌘U). This simple combo will just execute all the tests in the current scheme. But what other options do we have?
So, if you want to run all your tests without rebuilding the whole project just hit Ctrl+CMD+U
(⌃⌘U). In the previuos tip I have already mentioned another, pretty smilar sortcut to run your project without building.
This might be really useful if you are aiming to iterate on a single test and you want to run only that specific test. Hit Ctrl+Option+CMD+U
(⌃⌥⌘U). With this shortcut, you can run the test in which your cursor is.
Imagine, you are refactoring some class and you want to make sure that you didn’t break any existing logic. For that, you can execute some specific test and then, after each phase of refactoring, while still having your class open in the editor, hit Ctrl+Option+CMD+G
(⌃⌥⌘G). Using the same combo you can run the whole test suite if it was executed before.
I hope this will help you to improve your coding productivity 😉
Happy coding!