Saturday, July 25, 2009

Chapter 2 – iPhone SDK – An Introduction

Are you ready to start iPhone programming ? Are you ready with your Intel based Mac Machine? Then you need Apple’s iPhone Software Development Kit (iPhone SDK). This is free and is available to the members of Apple’s Developer Program.

iPhone SDK include Xccode (IDE) and iPhone Simulator along with lots of other tools.
Xcode is Apple’s Integrated IDE and we can use it for creating, debugging, compiling and performance tuning application. Simulator allows us to run iPhone application on Mac

Latest version of iPhone SDK is iPhone SDK 3.0.This release includes bug fixes and usability enhancements, including a more accurate iPhone Simulator

Downloading iPhone SDK

You can download iPhone SDK from Apple’s site at http://developer.apple.com/iphone. The steps involved in downloading iPhone SDK from this site is explained in my first blog (Chapter 1 - Beginning Your iPhone Programming Today - An Introduction).

Before download the iPhone SDK file, it will ask your Apple ID. If you don't have the Apple ID, just click the “Create Apple ID” button and fill your details in the form. Apple will send an email to your Email ID which is given by you during the registration. They send a confirmation mail and also give the link for downloading the SDK.

iPhone SDK installation is a file with extension .dmg. When I downloaded iPhone SDK, the file name was “iphone_sdk_3.0__leopard__9m2736__final.dmg”. It may vary

Pre-Requisite

iPhone SDK requires an Intel-based Mac running Mac OS X Leopard version 10.5.7 or later. . The file size is around 2134 MB.

Installing iPhone SDK in your Mac Machine

The steps involved for installing iPhone SDK is explained here

  1. After downloading iPhone SDK to your Mac machine, double click on the file with extension .dmg extension. This will display a window like this

  2. Please Select iPhone SDK icon in this window and double click on it. For now discard other icons displayed in that window. Then we will get the following window
  3. Click Continue to continue the installation. This will display a window looks like the below one
  4. From the above screen, you can select required tools using “Custom Install”. Now please select the options shown in the above figure and then click Continue button. This will display a window like the on shown in the following figure
  5. From this window, you can change the installation location for installing the SDK or we can install SDK in the default location. The default installation location for iPhone SDK installation is /Developer. After this click Install to start the installation

  6. During the installation, we need to enter Mac Username and Password (as shown in the above figure)
  7. After validating the entered information (Username and Password), the installation process will start. The installation progress is shown in a window. This window looks like

  8. If there is no interrupt, the installation will succeed and we will get a window like

Now iPhone SDK installation is completed and you can clsoe the window

Tools

The most important tools comes with iPhone SDK are Simulator, Xcode, Interface Builder, Instruments and Dashcode. The following section give a small introduction to these tools

Simulator

iPhone SDK includes a simulator that will allow you to run your iPhone application on Mac. This enables you to create and test applications on your desktop. Simulator does not support hardware dependent features such as camera. But this is helpful for iPhone development and studying.. You can do this without connecting to an actual iPhone or iPod touch. The Simulator offers the same API used on the iPhone and provides a preview of how your concept designs will look

Xcode

Xcode is Apple’s Integrated IDE and we can use it for creating, debugging, compiling and performance tuning application. It is the most important tool in the iPhone development. It provides a project development and management environment. It includes source editing, documentation, and a graphical debugger. It is built around several open source GNU tools, namely gcc (compiler) and gdb (debugger). The complete Mac OS X developer tools chain is distributed as part of Xcode .These tools include Interface Builder, Dashcode, Instruments and the WebObjects framework

Interface Builder

Interface Builder is Apple's graphical editor for designing user interface components. Developers can use IB to create user interfaces by dragging user interface elements such as buttons, labels or text fields from a palette of predefined controls and dropping them into the window or view. Interface Builder works with Xcode.

Instruments

Instruments are the tool used for tracking memory leaks and making sure your applications run efficiently without any problem on iPhone and iPod Touch. It includes graphical time based performance plots that show where your applications are using the most resources. It shows memory usage and monitors performance. As a developer, this helps you to identify the problem areas in your applications. It is build around the open source DTrace package (developed by Sun Microsystems)

Dashcode

Dashcode allow you to create Web applications (web widgets) that you can run outside of a browser environment (safari).

For now this explanation is enough. We will discuss more about each and every tool in coming chapters.

No comments:

Post a Comment