So you’ve downloaded one of our iOS projects and now you want to run it. In this article, we’re going to focus on how to run our Xcode projects. This tutorial is assuming you’ve never done iOS development in your life – if you’re already a pro, you might want to skip some steps – you’ll figure out which ones since you’re a pro 🙂

1. Install Xcode

First of all, you need to install the latest version of Xcode. It can be downloaded for free from Apple’s website. Make sure you download the latest GM version, and not a beta one. You can still try to run our templates in Xcode Beta, but keep in mind they are more stable on the GM release.

2. Install Cocoapods

Cocoapods is a dependency manager for Swift projects. In our apps we use a few popular open-source libraries, to make coding more fun (e.g. Firebase, Alamofire, SnapKit, etc.). Their source code needs to be downloaded before the Xcode project runs, and Cocoapods is the tool in charge with that. You can follow the instructions on how to install Cocoapods by heading over to their website, or you can simply try and run

sudo gem install cocoapods

3. Install the pods

Once you’ve unarchived the downloaded .zip file, locate the folder in your terminal and run “pod update”.

cd ~/Downloads/XAppTemplate
pod update

You should get this successful output:

xcode projects

4. Open .xcworkspace file in Xcode

The command above will generate a .xcworkspace file (NameOfAppTemplate.xcworkspace), which should then be opened in Xcode. Please make sure you are opening the .xcworkspace file, and not the .xcodeproj file, since this is a common mistake and the code won’t run.

5. Run the Xcode project

To run the Xcode project, you can click the “Play” (Run) button on the top left corner, or you can simply press Command + R. Make sure you select which specific device or simulator you want the app to run on since the Generic iOS Device won’t work. Once Xcode project builds, your app should be up and running in the simulator like in the image below:

run xcode project

Great job! Now that you’re able to run the app in Xcode successfully, head over to the next step that helps you link the app to your own Firebase backend.

 

Shopping Cart