Setting up Xcode

November 1, 2019

General Coding, Reference

Comments Off on Setting up Xcode


One of the crucial tools to develop code and build iOS apps is a software called Xcode. Xcode is an IDE (Integrated Development Environment) that helps you write and organize code, compile the code into an app and debug your app using a simulator or physical device.

The process for setting up Xcode can be easy as pie. Here is a quick start guide to setting up Xcode on your Mac.

Sign up

If you don’t have an Apple ID, you can head over to appleid.apple.com to create a new account.

Once you have an Apple ID you can register for a developer account at developer.apple.com/register.

Download

There are two ways to download Xcode. For most developers, especially those just starting out, I’d recommend getting Xcode through the App Store.

Alternately, you can get Xcode from the developer portal. Go back to developer.apple.com and click Develop, then Downloads. Here you can download the latest Beta version of Xcode. I don’t recommend that you learn on a Beta version so click the Release button on the downloads banner to download the latest release version. At some point you may have a need to download an older version of Xcode, you can get them by clicking More.

Install

Once you’ve downloaded Xcode, open it and you’ll see a license agreement. If you agree, Xcode will need you to enter your computer password to install additional components. Once completed, you are ready to start building apps. The rest of the steps do not have to be completed right now but I’d recommend you get it out of the way.

Enter credentials for Xcode

Eventually, you’ll want to run your apps on a real device. To do that you’ll need a signing certificate and provisioning profile. This is more of an advanced topic for another day. The good news is that Xcode can manage all of this for you if you log into your Apple developer account within Xcode.

Open Xcode and under the Xcode menu, select Preferences… then Accounts. The + button toward the bottom left will allow you to add various accounts. Select Apple ID and enter your credentials. You can also sign up if you skipped it previously.

It’s also a good idea to use an SCM (Source Control Management) tool. Git is the preferred tool. There are a few services for managing your git repositories such as Github, Bitbucket, or GitLab. If you have an account for one or more of these it will be convenient to sign in to these accounts as well.

Physical devices & Simulators

Under the Window menu, select Devices and Simulators.

The first tab is where you can manage devices. Plug in a physical device to see it show up in the list. It will take a couple of minutes to set it up as a development device. Once that’s done, Xcode will be able to create a provisioning profile compatible with your app and device so that you can test out your app on a real device.

While having a physical device is critical for testing certain features, such as the camera, most of the time you likely develop on a simulator. Click on the Simulators tab so see a list of your current simulators.

You should see several devices listed with the current version of iOS installed by default. It’s easy to add devices, just hit the + button and select the combination you desire. It may be tempting to add a bunch of different device combos to test and try out but I recommend keeping this list fairly light.



Subscribe via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.





Swift Tweets