In this tutorial series we will explore a rarely discussed (but highly valuable) process of developing software that is disappointingly absent in the iOS and mobile world: Continuous Integration. Today's tutorial will teach you how to script your own Xcode builds!
Step 1: Write A Basic Bash Script
As always the best way to learn about something is to jump into it, so lets practice writing a very basic script that will print your name onto into the terminal.
Open a text editor and create a new file on your desktop called 'BashScript.sh' end enter the following text:
#!/bin/sh echo "Hello world from Bash!"
You should be able to figure out what happens in this script. Firstly (and the less obviously) we specify the shell we will be using for the script, in this instance 'sh' (if you don't know what a 'shell' is don't worry too much, its not required to write basic Bash scripts. You just need to know that the line is there for now) The second line simply prints 'Hello there!' onto your terminal window.
Let's try running it. Open a new terminal window and type the following:
If you see "Hello world from Bash!" it all worked!
Get the Full Series!
Joining Tuts+ Premium. . .
For those unfamiliar, the family of Tuts+ sites runs a premium membership service called Tuts+ Premium. For $19 per month, you gain access to exclusive premium tutorials, screencasts, and freebies from Mobiletuts+, Nettuts+, Aetuts+, Audiotuts+, Vectortuts+, and CgTuts+. You'll learn from some of the best minds in the business. Become a premium member to access this tutorial, as well as hundreds of other advanced tutorials and screencasts.