1. Trang chủ
  2. » Công Nghệ Thông Tin

Lập trình Wrox Professional Xcode 3 cho Mac OS part 1 potx

8 322 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 8
Dung lượng 2,33 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Installing the Xcode Developer Tools Choosing the install location and packages Upgrading Xcode Removing Xcode Xcode is part of the Xcode Developer Tools suite developed and distributed

Trang 1

Installing Xcode

WHAT'S IN THIS CHAPTER?

Installing the Xcode Developer Tools Choosing the install location and packages Upgrading Xcode

Removing Xcode Xcode is part of the Xcode Developer Tools suite developed and distributed by Apple If you haven ’ t installed it already, read this chapter to fi nd out how to do so If the tools are already installed, you can skip to the next chapter

If you ’ ve already installed Xcode, be aware that the default installation choices

do not include all Xcode components Features described in some chapters may require you to reinstall the omitted packages before you can use them Return

to this chapter to reinstall, upgrade, or remove the Xcode Developer Tools in your system

The Xcode Developer Tools encompass a huge amount of material: dozens of applications, scores of utilities, hundreds of sample projects, and thousands of pages of documentations

Despite its scope, the developer tools team at Apple has made it remarkably easy to install this wealth of tools in only a few minutes

Download at getcoolebook.com

Trang 2

THE XCODE INSTALLER

To install the Xcode Developer Tools, you must be running Mac OS X and have access to an Xcode

Developer Tools installer At the time this book was published, the current version of Xcode was

3.2, which requires that you be running Mac OS X 10.6 (aka Snow Leopard) or later This entire

book was written with, and assumes you are using, Xcode version 3.2 or later Although the tools

require Mac OS X 10.6 or later to run, you can develop code that ’ s compatible with systems as

old as Mac OS X 10.4 Some development packages, like the iPhone SDK, may have additional

hardware or operating system requirements The Xcode Developer Tools installer is available from

many sources Many fl avors of the Mac OS X operating system installer include a copy of the Xcode

Development Tools Updated versions are occasionally included in the monthly Apple Developer

Connection (ADC) DVD for download First check to see whether you have a recent version of the

Xcode developer tools already

The latest version of the Xcode Developer Tools can always be downloaded from the Apple

download the latest development tools, software development kits, and example code directly from

Apple Online ADC accounts are free and require only that you create an ADC account and agree

to the nondisclosure agreement that covers all Apple development technologies Student, Select,

and Premier accounts can be purchased and include many additional benefi ts One of these is the

monthly ADC mailing, mentioned earlier, which includes regular updates to tools and reference

material Other perks include discounts on hardware used for development and direct access to

Apple engineers for technical questions If you are serious about developing software for Mac

OS X or the iPhone OS, you should invest in a paid membership If you plan to sell your iPhone

applications through Apple ’ s App Store, you must have a paid iPhone developer account

Apple has never made incremental updaters for Xcode Every version of Xcode ever released has included a complete copy of the entire suite As such, there

is nothing to be gained by installing an earlier version of Xcode and then upgrading it to a later version Just install the latest version.

As of this writing, the Xcode developer tools installer is available in two forms The Xcode

download from the Mac Dev Center includes Xcode and all of the resources needed to develop

applications for Mac OS X The iPhone SDK from the iPhone Dev Center includes the entire Mac

OS X suite plus additional tools and frameworks for developing iPhone applications Installing

using the vanilla Xcode download enables you to develop applications for Mac OS X Installing the

iPhone SDK enables you develop both Mac OS X applications and iPhone applications

Trang 3

RUNNING THE INSTALLER

To start the installation process, open the XcodeTools or iPhone SDK package You can fi nd the

the left in Figure 1 - 1 The iPhone SDK package is in the iPhone SDK disk image, as shown on the right in Figure 1 - 1 Opening the package launches the installer utility

FIGURE 1-1

The installer presents a greeting screen Click the Continue button It next presents the software licensing agreement that accompanies the use of the developer tools provided by Apple, and possibly additional licensing agreements for iPhone and other SDKs The pop - up menu at the top of the window may allow you to read the licensing agreement in other languages Review the document using the scroll bar If you like, you can print or save the agreement for review or for your records

by clicking the Print or Save button

After you click the Continue button, a dialog box asks you to confi rm that you agree to the terms of the license Click the Agree button

If this is your fi rst installation, the installer may prompt you to choose the volume to install Choose your startup volume The Custom Install screen, shown in Figure 1 - 2, selects the packages you want installed and where By default, the bulk of the Xcode package is installed in the /Developer folder

of the startup volume Unless you have a compelling reason to change the installation location, accept the default /Developer folder

Download at getcoolebook.com

Trang 4

Beginning with Xcode 3.1, the Xcode tools, documentation, and frameworks can be installed in an

alternate location, allowing you to install several different versions of Xcode simultaneously For

example, you may need to keep a copy of Xcode 2.2 or 3.0 in order to maintain legacy projects To

install Xcode in an alternate location, select the pop - up button in the location column and choose

package is always installed in the /usr/bin directory, and WebObjects is always installed in

/Developer

The installer will present a default set of packages to install Alter the set of installation packages

by checking, or unchecking, each one in the list Select a package to display a brief description of its

contents

The following table explains the contents and usefulness of the various Xcode Developer Tools

packages

FIGURE 1-2

PACK AGE DESCRIPTION

Developer Tools Essentials This package contains the core set of development tools, including

the Xcode IDE and all of the Mac OS X SDKs You must install this package

iPhone SDK Includes the compilers, header fi les, libraries, frameworks,

documentation, and emulation tools used to develop iPhone applications

Trang 5

PACK AGE DESCRIPTION

System Tools Installs standalone system analysis tools such as Shark and DTrace

components These can be used independently or from within the Xcode IDE You should install this package

UNIX Development Support Installs a set of compilers and other command-line tools in

the /usr/bin directory Note that these are duplicates of the compilers installed by the Developer Tools Essentials Install this package if you intend to write shell scripts that perform builds or use makefi les that expect UNIX development tools to be in their traditional location

Mac OS X 10.4 Support Installs the compilers and SDKs compatible with Mac OS X 10.4

Install this only if you must produce code that runs on Mac

OS X 10.4

After you choose what you want to install, click the Continue button to start the installation process, shown in Figure 1 - 3 You will have to supply the account name and password of an administrator when asked

FIGURE 1-3

The bulk of the installation occurs in the /Developer folder, or whatever alternate location you chose, shown in Figure 1 - 4 Here you will fi nd all of the Xcode applications, command - line tools, example code, and documentation I recommend that you add the Xcode IDE application to your dock now

Download at getcoolebook.com

Trang 6

Do not attempt to move or rename this folder or any of its

contents The installer places support fi les in the system - wide

/Library/Application Support folder It installs some special

development frameworks, resources, and a few patches into

the /System folder UNIX tools and man pages are installed

in the /usr folder

After the installer is fi nished, check out any “ About ” documents

installed for an overview of the developers tools and for any late

-breaking news, additions, or corrections

Congratulations, you ’ ve installed Xcode! If you like, you can now

skip to Chapter 2

UPGRADING XCODE

If you already have an older version of Xcode installed, you ’ ll

fi nd some subtle differences when you run the installer again The

installer automatically detects the version of any package that

you have previously installed The packages, shown in Figure 1 - 5,

show which packages will be upgraded, installed, or skipped An

upgrade indicates that the installer has a newer version of the package to install The size indicates

the estimated amount of additional disk space required to upgrade the package Skipped packages

will not be upgraded or installed If a package is disabled, Xcode has determined that the existing

package does not need to be, or cannot be, upgraded This is typically because you already have the

most current, or a later, version installed The Xcode installer will never “ downgrade ” a package by

attempting to install an older version over a newer one

FIGURE 1-4

Trang 7

After you select the packages you want upgraded, click the Continue button The installer runs much as it does when installing for the fi rst time

Typically you won ’ t have any problems using your upgraded tools as soon as the installer is

fi nished However, if you immediately start using some of the performance analysis tools or attempt distributed builds, you may run into problems These facilities use daemons and system frameworks that may need to be reloaded Restart your system after upgrading your Xcode tools

REMOVING AND REINSTALLING XCODE

The Xcode Developer Tools provide the means for completely eradicating itself — the entire suite of tools, support fi les, libraries, and frameworks — from your system One really good reason to do this is to perform a clean installation of the tools Apple often makes pre - release versions of Xcode available to ADC members As a general rule, you cannot install a release version over a pre - release version even when that release version is newer You may also have some need to downgrade your installation, something the regular installation process won ’ t allow

To remove your installation of Xcode, open a Terminal window and enter the following command:

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

If you installed Xcode in a location other than /Developer , adjust the path accordingly If this fi le is not present — earlier versions of Xcode used different scripts stored in different locations — refer to the “ About ” document for the currently installed version to fi nd the appropriate script

The script must be run from an administrator ’ s account The sudo command prompts you for the password to that account

The script uses the receipts left by prior installations of Xcode to surgically remove everything that was previously installed It also takes care of a few special cases, such as removing symbolic links that get created during the post - installation process

The - - mode argument has four possible values, listed in the following table

MODE DESCRIPTION

all Removes all tools and directories installed by Xcode

systemsupport Removes only the UNIX support fi les (utilities, man pages, and so on) from the

startup volume

unixdev Removes the compilers and other command-line tools installed by the UNIX

Development Support package, described in the previous table

xcodedir Removes only the /Developer folder, or its alternative parent location

Equivalent to dragging the /Developer folder to the trash

Download at getcoolebook.com

Trang 8

After the old copy of the developer tools is removed, you can reinstall whatever version of Xcode

you want The installer treats this as a new installation, installing fresh copies of everything

After you reinstall the tools, you may need to restart your system The uninstall - devtools

script stops processes like the distributed build daemon, but the installer may not restart them

again Removing system frameworks and then replacing them with altered versions can seriously

confuse the operating system Restarting your computer causes all of these resources to be reloaded,

reinitialized, and restarted properly

SUMMARY

You ’ re probably eager to start exploring Xcode, but installing the software fi rst is a necessary evil

As you ’ ve seen, the process is relatively painless and quick

Now, on to the grand tour

Ngày đăng: 04/07/2014, 06:20