Search CTRL + K

Creating a Command Line macOS Project

From the menubar in Xcode, select File > New > Project...

Screenshot 2023-01-21 at 7.25.06 AM.png

Select the macOS tab and the Command Line Tool app template, then select Next:

Screenshot 2023-01-21 at 7.25.26 AM.png

Provide a meaningful name, using the CapitalCase style convention, then select Next:

Screenshot 2023-01-21 at 7.25.48 AM.png

Choose a location for the project on your computer, and be sure that source control is enabled, then select Create:

Screenshot 2023-01-21 at 7.26.30 AM.png

You will see something like this:

Screenshot 2023-01-21 at 7.26.40 AM.png

Select the main file in the Project Navigator at left.

Run your program by pressing Command-R or the ▶ button.

After a brief delay (that is longer the first time the program is run, and faster on subsequent runs) you will see program output:

Screenshot 2023-01-21 at 7.27.27 AM.png

You can close the Inspector panel by pressing Option-Command-0 (that's zero) or by tapping the button:

Screenshot 2023-01-21 at 7.27.44 AM.png

Before you continue working on your project, remember to create a remote on GitHub:

Screenshot 2023-01-21 at 7.28.11 AM.png

Default options when creating the remote repository will be fine – select Create:

Screenshot 2023-01-21 at 7.41.13 AM.png

Then remember to commit and push your work regularly.