Is there a keyboard shortcut in Xcode 6 to run the current test case under cursor? I know I can press Command + u to run all tests. Also, I can tap the test icon located to the left of the test function or tap the icon in 'Test Navigator'. Is there a keyboard shortcut to run only the single test function under cursor?
Run the current test:
Control + Option + Command + U
Re-Run the last test:
Control + Option + Command + G
-
1Has this changed in Xcode 8.2.1? I type control-option-command-U and all the tests in the current file are run. – Daniel Zhang Dec 21 '16 at 7:43
-
"Run the current test" as in the test or test class the cursor has focus in. – Steve Moser Aug 8 '17 at 15:41
-
@Daniel make sure the cursor is currently within the test case before using the shortcut – Harry Ng Dec 29 '17 at 2:31
control-option-command G
will let you rerun your last test. So if you run a single test the first time and then keep running it (a common workflow for TDD), that might save you some time ;)
The Xcode key binding preferences for these commands are:
Perform Action - Test
Perform Action - Test Again
Use those titles to find the commands for re-binding.
-
1Does anybody have any clues why after Xcode 10.2 update 'Product - Perform Action - Test' menu item stays inactive until the selected line is not the test class name? – Dren Apr 11 '19 at 10:24