Online Book Reader

Home Category

iPhone Game Development - Chris Craft [18]

By Root 1654 0
Me file, or follow these steps:

1. If you would like to uninstall Xcode developer tools on the boot volume, along with the directory, from a Terminal window use this command:

$ sudo /Library/uninstall-devtools --mode=all

2. If you would like to remove the underlying developer content on the boot volume but leave the directory and supporting files untouched, from a Terminal window use this command:

$ sudo /Library/uninstall-devtools --mode=systemsupport

3. If you would like to remove just the UNIX development support on the boot volume but leave the directory and supporting files untouched, from a Terminal window use this command:

$ sudo /Library/uninstall-devtools --mode=unixdev

4. If you would like to uninstall just the directory, you can simply drag it to the trash, or from a Terminal window use this command:

$ sudo /Library/uninstall-devtools --mode=xcodedir

Unless you are experienced, we recommend that you uninstall using the first option. By default the folder is installed in \Developer\Library. To run this uninstall command from the default location, follow these steps:

1. Open a terminal window.

2. Type cd / and press Enter.

3. Type sudo Developer/Library/uninstall-devtools --mode=all and press Enter.

Note

During installation and when running the uninstall command, you will be prompted for a password. Don't worry; this is your Mac OS protecting you. You will need to supply the administrative password that was used when setting up for your Mac.

Test-Driving the SDK

Now that you have installed your environment, it's time to run one of the samples from the iPhone Sample Code library. This tests your setup and makes sure your environment is in good health. We understand you are eager to get started, but you don't want to spend hours chasing a bug in your app only to find out there was a problem with your environment setup. Here is what you need to do to test your environment with one of Apple's Code Samples.

Getting a sample app to try out

Go back to iPhone Dev Center (http://developerapplecom/iphone and scroll down to the Sample Code link under the Resources for iPhone section, as shown in Figure 2.3. From there click the Sample Code link to navigate to a full listing of Apple's sample applications.

FIGURE 2.3

There are many useful resources in the Resources for iPhone section of iPhone Dev Center, including many examples in the Sample Code section


You will now be on the Sample Code page, which lists all available iPhone Dev Center sample applications (see Figure 2.4).

FIGURE 2.4

You will find a plethora of example applications in the iPhone Dev Center's Sample Code library.


Scroll down to the GLPaint example and click on it. This example takes advantage of the touchscreen and the accelerometer. When the page loads, you should be presented with a screen similar to Figure 2.5. Click on the Download Sample Code link.

Wait for the sample to finish downloading, then open it. Finder will unzip the GLPaint.zip archive and you will see the GLPaint folder in your download folder.

Now you should move the GLPaint folder to a new location if you do not want to keep it in the download folder. Open the GLPaint folder and double-click GLPaint.xcodeproj. You should now see the main Xcode window open with the GLPaint project open, as shown in Figure 2.6.

Tip

If you have not already docked Xcode on your Dock, now is a good time to do so. Click Keep in Dock from the Dock icon option menu.

FIGURE 2.5

On the GLPaint download page, you can download the full example or take a quick peek at the code files using the View Source Code dropdown box.


FIGURE 2.6

The GLPaint example project after it has been opened in Xcode


Running the sample in the iPhone Simulator

Now you will finally get to experience an iPhone application in action! From the GLPaint project toolbar, click Build and Go and the example will launch in the iPhone Simulator. If everything has been installed properly, you should see the GLPaint application

Return Main Page Previous Page Next Page

®Online Book Reader