1. Mac System: Mac Mini, iMac, Macbook pro or Mac pro
- 1. Goto App Store. Search for Xcode and install Xcode from there. Its heavy in size so it will take some time to download and install it. This guide is written with Xcode 6.1.
- 2. Install Xcode’s command line tools by typing following command into the Terminal. code-select —install A dialog will appear asking you to install the command line tools. Click Install. This is an optional step and most of the apps compile fine without Xcode tools also but install it anyway to avoid any unexpected issues.
- 3. If you have already installed Xcode then you should update it. All softwares are built on latest Xcode and latest Xcode ensure that your app is error free and works smoothly on latest iOS. To update goto App Store. Search for Xcode and if click install button. If it doesn’t show install option then go to Updates section of Xcode and install any updates related to Xcode.
Cocoapods is a dependancy manager for iOS (http://cocoapods.org/). All of our recent projects use
- 1. Type the following command in Terminal to install Cocoapods. sudo gem install cocoapods It will prompt you for your system password. Typing password wont show any characters for security purposes. Type your password and hit enter.
Test your setup
- 1. Download our test project at Github by typing following commands in Terminal. git clone https://github.com/mobilemerit/DemoXcode.git cd DemoXcode pod install
- 2. This will take some time and all the project dependancies will be updated.
- 3. Goto project folder and double click DemoXcode.xcworkspace. It will open in Xcode.
- 4. Run the project by pressing run button or hitting cmd + R.
- 5. iPhone Simulator will open and print s a text message (Fig 1).
- 6. If the Run button is greyed out then wrong scheme is selected. You have to create a new scheme. Click “New Scheme” by opening the scheme dropdown (Fig 1). A dialog will appear. Click OK (Fig 2).
- 7. When you’re done click stop button next to run button on top left or hit cmd + .
Testing in more environments
By default only few simulators are available but you can install more by going to Xcode >
Preferences > Downloads. Simulators are listed under components section. Click the small circular
grey button on the right of simulator name.
After that more options will be available in devices dropdown.