Member-only story

5 Must-Know Xcode Shortcuts for Unit Testing

No more clicking to start a unit test

Lee Kah Seng
4 min readMar 29, 2020
5 Must-Know Xcode Shortcuts for Unit Testing

Writing unit tests is a major part of the app development lifecycle. Xcode has some pretty useful built-in unit testing shortcuts, however, a lot of developers are not aware of their existence.

In this article, I will show you 5 unit testing shortcuts where you can leverage to improve your productivity while creating unit test cases or performing TDD.

Knowing the Mac Keyboard Symbols

Before we get started, here’s a quick revision of the Mac keyboard symbols.

The Mac keyboard symbols
The Mac keyboard symbols

With all that in mind, let’s check out the 5 must-know shortcuts for unit testing.

Build and Run All Test Cases

⌘U (command + U)

⌘U will build and run all your test cases. It is the most commonly used shortcut when creating unit test cases.

It is equivalent to ⌘R (build & run) while doing app development. You can use this shortcut to build your test target and run all the test cases in your test target.

--

--

Lee Kah Seng
Lee Kah Seng

Written by Lee Kah Seng

Support me by becoming a Medium member: https://leekahseng.medium.com/membership ⦿ 🇲🇾 Creator of https://swiftsenpai.com ⦿ iOS developer since 2011

No responses yet