Xcode is Apple’s development environment for their operating systems macOS, iOS, tvOS, and watchOS. If you want to develop software for Apple products you need to install Xcode as development environment.
Xcode is free for Mac owners and available from the App Store. To install the latest Xcode just search Xcode on the App Store and click the install button.
After you have installed Xcode, install the command line developer tools (CLDT). Open a Terminal and type the command:
$ sudo xcode-select --install
sudo executes the subsequent command as administrator. Therefore you are required to enter your password after hitting the Enter key.