You must have access to an Apple ID account. Xcode and Xcode Command Line Tools are only accessible through this method via Mac and other iOS Devices.
NOTE: You must have access to an Apple ID account: to register, click here. For this method, Xcode and Command Line Tools are only accessible via Mac and other iOS Devices.
Apple provides Mac devs with both Xcode and Command Line Unix Tools,but you’ll need to access Apple’s servers first in order to reach them:
Access your Mac’s Terminal Application or what’s otherwise referred to as the Console; anything typed into this terminal is sent straight to your device’s Operating System:
- Press “Command + Spacebar” to access Spotlight Search;
- Type in the word “Terminal” into the Spotlight search field and hit “Enter”; this should execute your Mac’s Terminal app;
- Type “gcc” into the terminal and hit “Enter” (gcc is a compiler that turns source code into executable applications). Alternatively, typing “xcode-select — install” into the terminal works just as well. Before installing Xcode Command Line Tools, click “Get Xcode”;
- In order to install Xcode from the App Store, you’ll need to first log-in through your Apple Id. If you haven’t already created one, you can do so by clicking here.
NOTE: the installation may not initiate until you’ve completed particular software updates. To check, click the Updates tab and select Update All
To monitor the installation’s progress, open Spotlight Search by pressing “Command + Spacebar” and type in/open up Launchpad.
Creating your first project
Upon opening Xcode, you’ll see this screen. Click on “Create a new Xcode Project”.
On the right hand side, you’ll notice a selection of different app templates. Select “Single-View Application” and click Next.
- Product Name: This is the name that will appear for users in the store and should be similar to the app name you’d later enter into iTunes. Let’s name this “MyFirstProject.”
- Organization Name: Affects not only the Bundle Identifier,but the bundle Identifier of every other application. Leave it as it is for now. The top of all your files will likely say your name, but we can edit that out later if need be.
- Organization Identifier: Set this to “com.example.[Your Name]” where – like in the picture above – [Your Name] represents your Organization Name after being shortened down: the Organization name David Murphy is changed to dmurphy.
The Devices tab lists the different devices that you’d like your app to run off of. For now, leave Universal as the selected option and click Next. On the next window hit Create after choosing your desired location – Desktop is assigned as default.
Congratulations! You’ve created your first Xcode Project!
Installing Xcode Command Line Tools
Xcode has almost everything you’ll need to program apps in a tightly packed 3.8 GB download; however, most developers will be coding more than just iOS applications, and most Macs come unequipped with the Unix tools that would otherwise let developers branch off into other territories of programming. The decision to exclude them was made to conserve space and avoid unnecessary storage usage, as Unix Tools were deemed necessary for iOS app developers.
To install Xcode Command Line Tools, navigate to your device’s Terminal app again through Spotlight Search. Then, type “xcode-select –install” into your terminal and hit Enter. Instead of clicking “Get Xcode” like before, find and click Install at the bottom-right-hand corner of the new window.
NOTE: If Xcode Command Line Tools was previously downloaded onto your device, you’ll likely get an error
- A Terms and Agreement screen will: Read it (or don’t); if you accept Apple’s Terms, then hit Agree to proceed with the installation;
- Once the installation is complete, click Done;
- Just to verify that you’ve downloaded the correct version, type “gcc –version” and the terminal will spit back the version that’s currently installed.
The entire command line toolkit package is located by default at /Library/Developer/CommandLineTools/.
Congratulations! You’ve successfully downloaded Xcode Command Line Tools!
This post was written by David Murphy for Messapps.