< Previous PageNext Page > Hide TOC

Mac OS X Developer Tools

Apple provides a number of applications and command-line tools to help you develop your software. These tools include compilers, debuggers, performance analysis tools, visual design tools, scripting tools, version control tools, and many others. Many of these tools are installed with Mac OS X by default but the rest require you to install Xcode first. Xcode is available for free from the Apple Developer Connection website. For more information on how to get these tools, see “Getting the Xcode Tools.”

Note: Documentation for most of the command-line tools is available in the form of man pages. You can access these pages from the command line or from Mac OS X Man Pages. For more information about using the command-line tools, see “Command Line Primer.”

In this section:

Applications
Command-Line Tools


Applications

Xcode includes numerous applications for writing code, creating resources, tuning your application, and delivering it to customers. At the heart of this group is the Xcode application, which most developers use on a daily basis. It provides the basic project and code management facilities used to create most types of software on Mac OS X. All of the tools are free and can be downloaded from the Apple developer website (see “Getting the Xcode Tools”).

In Mac OS X v10.5 and later, it is possible to install multiple versions of Xcode on a single computer and run the applications and tools from different versions side-by-side. The applications listed in the following sections are installed in <Xcode>/Applications, where <Xcode> is the root directory of your Xcode installation. The default installation directory for Xcode is the /Developer directory.

In addition to the applications listed here, Xcode also comes with numerous command-line tools. These tools include the GCC compiler GDB debugger, tuning tools, code management tools, performance tools, and so on. For more information about the available command-line tools, see “Command-Line Tools.”

Xcode

The centerpiece of the Xcode Tools is the Xcode application, which is an integrated developer environment (IDE) with the following features:

Figure C-1 shows the Xcode project workspace and some key inspector windows. In the Xcode preferences, you can configure numerous aspects of the workspace to suit your preferred work style.


Figure C-1  Xcode application

Xcode application

For information on how to use Xcode, see Xcode User Guide.

Xcode Editor

The Xcode editing environment is a high-performance code editor that includes many features that go beyond basic text editing. These features aim to help developers create better code faster and include the following:

Debugging Environment

In Xcode 3.0, there is no distinction between “Running” your executable and “Debugging” it. Instead, you simply build your executable and run it. Hitting a breakpoint interrupts the program and displays the breakpoint either in the current editor window or in the debugger window. Other features of the debugging environment include the following:

Research Assistant

The Research Assistant is an inspector that displays documentation for the currently selected text (see Figure C-1). As the selection changes, the Research Assistant updates the information in its floating window to reflect the classes, methods, and functions you are currently using. This window shows the declaration, abstract, and availability information for the selection along with the framework containing the selected identifier, relevant documentation resources, and related methods and functions you might be interested in using.

Documentation Window

The documentation window (Figure C-2) in Xcode provides an environment for searching and browsing the documentation. This window provides you with fast access to Apple’s developer documentation and gives you tools for searching its content. You can search by title, by language, and by content and can focus your search on the documents in a particular documentation set.


Figure C-2  Xcode documentation window

Xcode documentation window

Documentation sets are collections of documents that can be installed, browsed, and searched independently. Documentation sets make it easier to install only the documentation you need for your development, reducing the amount of disk space needed for your developer tools installation. In addition to the Apple-provided documentation sets, third parties can implement their own documentation sets and have them appear in the Xcode documentation window. For information on how to create custom documentation sets, see Documentation Set Guide.

SCM Repository Management

Xcode supports the management of multiple SCM repositories to allow you to perform tasks such as the following:

Xcode supports CVS, Subversion, and Perforce repositories.

Project Snapshots

Project snapshots provide a lightweight form of local source control for Xcode projects. Using this feature, you can take a “snapshot” of your project’s state at any point during development, such as after a successful build or immediately prior to refactoring your code. If after making subsequent changes you decide those changes were not useful, you can revert your project files back to the previous snapshot state. Because snapshots are local, your intermediate changes need never be committed to source control.

Refactoring Tools

Xcode’s refactoring tools let you make large-scale changes to your Objective-C source code quickly and easily. Xcode propagates your change requests throughout your code base, making sure that the changes do not break your builds. You can make the following types of changes using the refactoring tools:

Before making any changes to your code, Xcode’s refactoring tools automatically take a local snapshot of your project. This automatic snapshot means you can experiment with refactoring changes without worrying about irrevocably changing your project files. For more information on snapshots, see “Project Snapshots.”

Build Settings

The Build pane in the inspector organizes the build settings for the selected target, providing search tools to help you find particular settings. In Mac OS X v10.5, some particularly noteworthy additions to this pane include the following:

Project Versioning

Xcode projects include a Compatibility pane in the project inspector that lets you determine whether you want an Xcode 3.0–only project or one that can be used by previous versions of Xcode. Marking a project as Xcode 3.0–only generates an alert whenever you try to use an Xcode feature that is not present in previous versions of the application.

Interface Builder

The Interface Builder application provides a graphical environment for building the user interface of your Carbon and Cocoa applications. Using Interface Builder, you assemble the windows and menus of your application, along with the any other supporting objects, and save them in one or more resource files, called nib files. When you want to load a user interface element at runtime, you load the nib file. The Cocoa and Carbon infrastructure uses the data in the nib file to recreate the objects exactly as they were in Interface Builder, with all their attributes and inter-object relationships restored.

Although present in all versions of Mac OS X, the Interface Builder application received a significant overhaul in Mac OS X v10.5. Beyond the numerous cosmetic changes, the current version of Interface Builder includes numerous workflow and infrastructure changes too. The connections panel replaces the old technique for connecting objects in Cocoa nib files, making it possible to create multiple connections quickly without going back and forth between the inspector and the objects in your nib file. An improved library window helps you organize and find the components you use most frequently. Interface Builder includes a new plug-in model that makes it possible to create fully functional plug-ins in a matter of minutes. And most importantly, Interface Builder is more tightly integrated with Xcode, providing automatic synchronization of project’s class information with the corresponding source files.

Figure C-3 shows the Interface Builder environment in Mac OS X v10.5, including a nib document, connections panel, inspector window, and library window. The library window contains the standard components you use to build your user interfaces and includes all of the standard controls found in Carbon and Cocoa applications by default. Using plug-ins, you can expand the library to include your own custom objects or to include custom configurations of standard controls.


Figure C-3  Interface Builder 3.0

Interface Builder 3.0

For information about Interface Builder features and how to use them, see Interface Builder User Guide. For information about how to integrate your own custom controls into Interface Builder, see Interface Builder Plug-In Programming Guide and Interface Builder Kit Framework Reference.

Dashcode

Introduced in Mac OS X v10.5, Dashcode is an integrated environment for laying out, coding, and testing Dashboard widgets. Although users see and use widgets as applications, they’re actually packaged webpages powered by standard technologies such as HTML, CSS, and JavaScript. Although it is easy for anyone with web design experience to build a widget using existing webpage editors, as a widget’s code and layout get more complex, managing and testing of that widget becomes increasingly difficult. Dashcode provides the following features to help simplify the widget design process:

Figure C-4 shows the Dashcode canvas, inspector, and library windows. The canvas is a drag-and-drop layout environment where you lay out widgets visually. Using the inspector window, you can apply style information to the controls, text, and shape elements that you drag in from the library.


Figure C-4  Dashcode canvas

Dashcode canvas

For more information about Dashcode, see Dashcode User Guide.

Instruments

Introduced in Mac OS X v10.5, Instruments is an advanced debugging and performance analysis application. Instruments provides unprecedented information about the runtime behavior of your application and complements existing tools such as Shark. Rather than show one aspect of your program at a time, you configure each analysis session with one or more “instruments”, each of which gathers information about things such as object allocation patterns, memory usage, disk I/O, CPU usage, and many more. The data from all instruments is shown side-by-side, making it easier to see patterns between different types of information.

An important aspect of Instruments is the repeatability of data gathering operations. Instruments lets you record a sequence of events in your application and store them in the master track. You can then replay that sequence to reproduce the exact same conditions in your application. This repeatability means that each new set of data you gather can be compared directly to any old sets, resulting in a more meaningful comparison of performance data. It also means that you can automate much of the data gathering operation. Because events are shown alongside data results, it is easier to correlate performance problems with the events that caused them.

Figure C-5 shows the Instruments user interface for an existing session. Data for each instrument is displayed along the horizontal axis. Clicking in those data sets shows you information about the state of the application at that point in time.


Figure C-5  The Instruments application interface

The Instruments application interface

For information about how to use Instruments, see Instruments User Guide.

Quartz Composer

Introduced in Mac OS X version 10.4, Quartz Composer is a development tool for processing and rendering graphical data. Quartz Composer provides a visual development environment (Figure C-6) built on technologies such as Quartz 2D, Core Image, OpenGL, and QuickTime. You can use Quartz Composer as an exploratory tool to learn the tasks common to each visual technology without having to learn its application programming interface (API). You can also save your compositions as resource files that can be loaded into a Cocoa window at runtime. In addition to supporting visual technologies, Quartz Composer also supports nongraphical technologies such as MIDI System Services and Rich Site Summary (RSS) file content.


Figure C-6  Quartz Composer editor window

Quartz Composer editor window

For information on how to use Quartz composer, see Quartz Composer User Guide.

AppleScript Studio

You can use AppleScript Studio to create AppleScript applications with complex user interfaces that support the Aqua human interface guidelines. AppleScript Studio is a combination of technologies, including AppleScript, Cocoa, the Xcode application, and Interface Builder.

For more information about AppleScript Studio, see AppleScript Studio Programming Guide or AppleScript Studio Terminology Reference.

Audio Applications

The <Xcode>/Applications/Audio directory contains applications for Core Audio developers.

AU Lab

Introduced in Mac OS X version 10.4, AU Lab (Audio Unit Lab) lets you graphically host audio units and examine the results. You can use AU Lab to test the audio units you develop, do live mixing, and playback audio content. Parameters for the audio units are controlled graphically using the audio unit’s custom interface or using a generic interface derived from the audio unit definition. Figure C-7 shows the AU Lab interface and some of the palettes for adjusting the audio parameters.


Figure C-7  AU Lab mixer and palettes

AU Lab mixer and palettes

HALLab

Introduced in Mac OS X version 10.5, the HALLab (Hardware Abstraction Layer Lab) application helps developers test and debug audio hardware and drivers. You can use this application to understand what the audio hardware is doing and to correlate the behavior of your application with the behavior of the underlying audio driver. The application provides information about the properties of objects in the HAL and provides an I/O cycle telemetry viewer for diagnosing and debugging glitches your application’s audio content.

Graphics Applications

Table C-1 lists the applications found in the <Xcode>/Applications/Graphics Tools directory.

Table C-1  Graphics applications

Application

Description

Core Image Fun House

Introduced in Mac OS X v10.5, this application provides an environment for testing the effects of Core Image filters. Using this application, you can build up a set of filters and apply them to an image or set of images. You can apply both static and time-based effects and change the parameters of each filter dynamically to see the results.

OpenGL Driver Monitor

An application that displays extensive information about the OpenGL environment.

OpenGL Profiler

An application that creates a runtime profile of an OpenGL-based application. The profile contains OpenGL function-call timing information, a listing of all the OpenGL function calls your application made, and all the OpenGL-related data needed to replay your profiling session.

OpenGL Shader Builder

An application that provides real-time entry, syntax checking, debugging, and analysis of vertex/fragment programs. It allows you to export your creation to a sample GLUT application, which performs all the necessary OpenGL setup, giving you a foundation to continue your application development. OpenGL is an open, cross-platform, three-dimensional (3D) graphics standard that supports the abstraction of current and future hardware accelerators. For more information about OpenGL, see OpenGL Programming Guide for Mac OS X in the Reference Library > Graphics & Imaging area.

Pixie

A magnifying glass utility for Mac OS X. Pixie is useful for doing pixel-perfect layout, checking the correctness of graphics and user interface elements, and getting magnified screen shots.

Quartz Composer Visualizer

A utility for previewing Quartz Composer compositions.

Quartz Debug

This is an alias to the Quartz Debug application in the <Xcode>/Applications/Performance Tools directory. For more information, see the entry for Quartz Debug in “Performance Applications.”

Java

Table C-2 lists the applications found in the <Xcode>/Applications/Java Tools directory.

Table C-2  Java applications

Application

Description

Applet Launcher

An application that acts as a wrapper for running Java applets.

Jar Bundler

An application that allows you to package your Java program’s files and resources into a single double-clickable application bundle. Jar Bundler lets you modify certain properties so your Java application behaves as a better Mac OS X citizen and lets you specify arguments sent to the Java virtual machine (VM) when the application starts up.

Performance Applications

Table C-3 lists the applications found in the <Xcode>/Applications/Performance Tools directory.

Table C-3  Performance applications

Application

Description

BigTop

An application that presents statistics about the current system activity and lets you track those statistics over time. This application is a more visually oriented version of the top command-line tool. It provides information about CPU usage, disk and network throughput, memory usage, and others. For information on how to use this program, see the application help.

MallocDebug

An application for measuring the dynamic memory usage of applications and for finding memory leaks. For information on how to use this program, see the application help or Memory Usage Performance Guidelines.

Quartz Debug

A debugging utility for the Quartz graphics system. For information on how to use this program, see the application help or Drawing Performance Guidelines.

Shark

An application that profiles the system to see how time is being spent. It can work at the system, task, or thread level and can correlate performance counter events with source code. Shark’s histogram view can be used to observe scheduling and other time-dependent behavior. It can produce profiles of hardware and software performance events such as cache misses, virtual memory activity, instruction dependency stalls, and so forth. For information on how to use this program, see the application help.

Spin Control

An application that samples applications automatically whenever they become unresponsive and display the spinning cursor. To use this application, you launch it and leave it running. Spin Control provides basic backtrace information while an application is unresponsive, showing you what the application was doing at the time.

Thread Viewer

An application for graphically displaying activity across a range of threads. It provides timeline color-coded views of activity on each thread. By clicking a point on a timeline, you can see a sample backtrace of activity at that time.

ZoneMonitor

An application for analyzing memory usage.

Table C-4 lists the applications in the <Xcode>/Applications/Performance Tools/CHUD directory and its subdirectories.

Table C-4  CHUD applications

Application

Description

Reggie SE

An application that examines and modifies CPU and PCI configuration registers in PowerPC processors.

PMC Index

An application for finding performance counter events and their configuration.

Saturn

An application that is an exact, function-level profiler for your application. Unlike sampling programs, which gather call stacks at periodic intervals, you can use this application to generate and view a complete function call trace of your application code.

SpindownHD

An application that monitors the power state of hard drives connected to the computer.

Utility Applications

Table C-5 lists the applications found in the <Xcode>/Applications/Graphics Tools directory and its subdirectories.

Table C-5  Utility applications

Application

Description

Accessibility Inspector

An agent application that lets you roll the mouse cursor over items in your application’s user interface and view their associated accessibility attributes and actions.

Accessibility Verifier

An application that looks for mistakes in the accessibility information provided by your application.

Bluetooth Explorer

An application for discovering and getting information about Bluetooth devices.

Build Applet

An application for creating applets from Python scripts.

Clipboard Viewer

An application that displays the contents of the various system pasteboards.

CrashReporterPrefs

An application for configuring the user notifications generated when an application crashes.

FileMerge

An application that compares two ASCII files or two directories. For a more accurate comparison, you can compare two files or directories to a common ancestor. After comparing, you can merge the files or directories.

Help Indexer

An application to create a search index for a help file. Instructions for creating Apple Help and for using the indexing tool are in Apple Help Programming Guide.

Icon Composer

An application for creating and examining icon resource files.

IORegistryExplorer

An application that you can use to examine the configuration of devices on your computer. IORegistryExplorer provides a graphical representation of the I/O Registry tree. For information on how to use this application, see I/O Kit Fundamentals.

iSync Plug-in Maker

This application creates device drivers that allow the synchronization of custom hardware devices. For more information, see “iSync Plug-in Maker.”

PackageMaker

An application for creating installable application packages from the set of files you provide.

PacketLogger

An application for logging Bluetooth packets.

Property List Editor

An application that lets you read and edit the contents of a property list. A property list, or plist, is a data representation used by Cocoa and Core Foundation as a convenient way to store, organize, and access standard object types. Property lists are useful when you need to store small amounts of persistent data. If you do use property lists, the .plist files must be bundled with other application files when you create your installation package.

Repeat After Me

An application designed to improve the pronunciation of text generated by the Text-To-Speech system.

SRLanguageModeler

An application for building language models for use with the Speech Recognition manager.

Syncrospector

A debugging application you use to inspect the truth database, the call history of sync sessions, and clients of the synchronization engine. For information on how to use this application, see Sync Services Tutorial.

USB Prober

An application that displays detailed information about all the USB ports and devices on the system.

iSync Plug-in Maker

The iSync Plug-in Maker application is a tool that allows you to build, test, and release plug-ins that handle the specific features supported by your hardware device. You use this application to configure your device settings and write scripts for connecting it to the Internet. The application also provides a suite of standard automated tests that you can use to detect and fix problems in your plug-in before you ship it.

Figure C-8 shows the iSync Plug-in Maker edit window.


Figure C-8  iSync Plug-in Maker application

iSync Plug-in Maker application

For information about using iSync Plug-in Maker, see iSync Plug-in Maker User Guide.

PackageMaker

You use PackageMaker to create installation packages for your software. An installation package is a convenient way to deliver software in all but the simplest cases. An installation package contains the files to install, their locations, and any licensing information or supporting materials that go with your software. When the user double-clicks an installation package, Mac OS X automatically launches the Installer application, which proceeds to install the files contained in the package.

You can use PackageMaker to package files or to assemble individual packages into a single package. Figure C-9 shows the PackageMaker user interface, which provides a graphical environment for building your packages.


Figure C-9  PackageMaker application

PackageMaker application

For information on how to use PackageMaker, see PackageMaker User Guide.

Command-Line Tools

Xcode includes numerous command-line tools, including the GCC compiler, GDB debugger, performance tools, version control system tools, localization tools, scripting tools, and so on. Some of these tools are found on most other BSD-based installations while others were created specifically for Mac OS X. They come free with the rest of Xcode, which you can download from the Apple developer website (see “Getting the Xcode Tools”).

In Mac OS X v10.5 and later, it is possible to install multiple versions of Xcode on a single computer and run the applications and tools from different versions side-by-side. Most of the tools listed in the following sections are installed in either in the system’s /usr/bin directory or in <Xcode>/usr/bin or <Xcode>/usr/sbin, where <Xcode> is the root directory of your Xcode installation, although tools installed elsewhere are called out as such. The default installation directory for Xcode is the /Developer directory.

In addition to the command-line tools listed here, Xcode also comes with many higher-level applications. These tools include the Xcode integrated development environment, Interface Builder, Instruments, and many others. For more information about the available applications, see “Applications.”

Note: The following sections describe some of the more important tools provided with Xcode but should by no means be considered a complete list. If the tool you are looking for is not described here, check the system and Xcode tools directories or see Mac OS X Man Pages.

Compiler, Linker, and Source Code Tools

Apple provides several applications and command-line tools for creating source code files.

Compilers, Linkers, Build Tools

Table C-6 lists the command-line compilers, linkers, and build tools. These tools are located in <Xcode>/usr/bin and <Xcode>/Private.

Table C-6  Compilers, linkers, and build tools

Tool

Description

as

The Mac OS X Mach-O assembler. See as man page.

bsdmake

The BSD make program. See bsdmake man page.

gcc

The command-line interface to the GNU C compiler (GCC). Normally you invoke GCC through the Xcode application; however, you can execute it from a command line if you prefer. See gcc man page.

gnumake

The GNU make program. See gnumake man page.

jam

An open-source build system initially released by Perforce, which provides the back-end for the Xcode application’s build system. It is rarely used directly from the command line. Documented on the Perforce website athttp://www.perforce.com/jam/jam.html.

ld

Combines several Mach-O (Mach object) files into one by combining like sections in like segments from all the object files, resolving external references, and searching libraries. Mach-O is the native executable format in Mac OS X. See ld man page.

make

A symbolic link to gnumake, the GNU make program. Note that the Xcode application automatically creates and executes make files for you; however the command-line make tools are available if you wish to use them. See make man page.

mkdep

Constructs a set of include file dependencies. You can use this command in a make file if you are constructing make files instead of using Xcode to build and compile your program. See mkdep man page.

pbprojectdump

Takes an Xcode project (.pbproj) file and outputs a more nested version of the project structure. Note that, due to how conflicts are reflected in the project file, pbprojectdump cannot work with project files that have CVS conflicts.

xcodebuild

Builds a target contained in an Xcode project. This command is useful if you need to build a project on another computer that you can connect to with Telnet. The xcodebuild tool reads your project file and builds it just as if you had used the Build command from within the Xcode application. See xcodebuild man page.

Library Utilities

Table C-7 lists the command-line tools available for creating libraries. These tools are located in <Xcode>/usr/bin.

Table C-7  Tools for creating and updating libraries

Tool

Description

libtool

Takes object files and creates dynamically linked libraries or archive (statically linked) libraries, according to the options selected. The libtool command calls the ld command. See libtool man page.

lorder

Determines interdependencies in a list of object files. The output is normally used to determine the optimum ordering of the object modules when a library is created so that all references can be resolved in a single pass of the loader. See lorder man page.

ranlib

Adds to or updates the table of contents of an archive library. See ranlib man page.

redo_prebinding

Updates the prebinding of an executable or dynamic library when one of the dependent dynamic libraries changes. (Prebinding for user applications is unnecessary in Mac OS X v10.3.4 and later.) See redo_prebinding man page.

update_prebinding

Updates prebinding information for libraries and executables when new files are added to the system. (Prebinding for user applications is unnecessary in Mac OS X v10.3.4 and later.) See update_prebinding man page.

Code Utilities

Table C-8 lists applications and command-line tools for manipulating source code and application resources. These tools are located in <Xcode>/usr/bin and /usr/bin.

Table C-8  Code utilities

Tool

Description

fpr

Reformats a Fortran file for printing by the UNIX line printer. See fpr man page.

fsplit

Takes a Fortran multiple-routine source-code file and splits it into multiple files, one for each routine. See fsplit man page.

ifnames

Scans C source files and writes out a sorted list of all the identifiers that appear in #if, #elif, #ifdef, and #ifndef directives. See ifnames man page.

indent

Formats C source code. See indent man page.

nmedit

Changes global symbols in object code to static symbols. You can provide an input file that specifies which global symbols should remain global. The resulting object can still be used with the debugger. See nmedit man page.

plutil

Can check the syntax of a property list or convert it from one format to another (XML or binary). See plutil man page.

printf

Formats and prints character strings and C constants. See printf man page.

ResMerger

Merges resources into resource files. When the Xcode application compiles Resource Manager resources, it sends them to a collector. After all Resource Manager resources have been compiled, the Xcode application calls ResMerger to put the resources in their final location. See ResMerger man page.

RezWack

Takes a compiled resource (.qtr) file and inserts it together with the data fork (.qtx or .exe file) into a Windows application (.exe) file. The resulting file is a Windows application that has the sort of resource fork that QuickTime understands. You can use the Rez tool to compile a resource source (.r) file. The RezWack tool is part of the QuickTime 3 Software Development Kit for Windows. See RezWack man page.

tops

Performs universal search and replace operations on text strings in source files. See tops man page.

unifdef

Removes #ifdef, #ifndef, #else, and #endif lines from code as specified in the input options. See unifdef man page.

UnRezWack

Reverses the effects of RezWack; that is, converts a single Windows executable file into separate data and resource files. See UnRezWack man page.

Debugging and Tuning Tools

Apple provides several tools for analyzing and monitoring the performance of your software. Performance should always be a key design goal of your programs. Using the provided tools, you can gather performance metrics and identify actual performance problems. You can then use this information to fix the problems and keep your software running efficiently.

General Tools

Table C-9 lists the command-line tools available for debugging. These tools are located in <Xcode>/usr/bin and /usr/bin.

Table C-9  General debugging tools

Tool

Description

defaults

Lets you read, write, and delete Mac OS X user defaults. A Mac OS X application uses the defaults system to record user preferences and other information that must be maintained when the application is not running. Not all these defaults are necessarily accessible through the application’s preferences. See defaults man page.

gdb

The GNU debugger. You can use it through the Xcode application or can invoke it directly from the command line. See gdb man page.

Memory Analysis Tools

Table C-10 lists the applications and command-line tools for debugging and tuning memory problems. These tools are located in <Xcode>/usr/bin and /usr/bin.

Table C-10  Memory debugging and tuning tools

Tool

Description

heap

Lists all the objects currently allocated on the heap of the current process. It also describes any Objective-C objects, listed by class. See heap man page.

leaks

Examines a specified process for malloc-allocated buffers that are not referenced by the program. See leaks man page.

malloc_history

Inspects a given process and lists the malloc allocations performed by it. This tool relies on information provided by the standard malloc library when debugging options have been turned on. If you specify an address, malloc_history lists the allocations and deallocations that have manipulated a buffer at that address. For each allocation, a stack trace describing who called malloc or free is listed. See malloc_history man page.

vmmap

Displays the virtual memory regions allocated in a specified process, helping you understand how memory is being used and the purpose of memory (text segment, data segment, and so on) at a given address. See vmmap man page.

vm_stat

Displays Mach virtual memory statistics. See vm_stat man page.

Examining Code

Table C-11 lists the applications and command-line tools for examining generated code files. These tools are located in <Xcode>/usr/bin and /usr/bin.

Table C-11  Tools for examining code

Tool

Description

c2ph

Parses C code and outputs debugger information in the Stabs format, showing offsets of all the members of structures. For information on Stabs, see STABS Debug Format. See c2ph man page.

cscope

An interactive command-line tool that allows the user to browse through C source files for specified elements of code, such as functions, function calls, macros, variables, and preprocessor symbols. See cscope man page.

ctags

Makes a tags file for the ex line editor from specified C, Pascal, Fortran, YACC, Lex, or Lisp source files. A tags file lists the locations of symbols such as subroutines, typedefs, structs, enums, unions, and #defines. See ctags man page.

error

Analyzes error messages and can open a text editor to display the source of the error. The error tool is run with its input connected via a pipe to the output of the compiler or language processor generating the error messages. Note that the service provided by the error command is built into the Xcode application. See error man page.

ibtool

Lets you print, update, and verify the contents of a nib file. You can use this tool to inject localized strings into a nib file or scan the contents of a nibfile using a script. (This tool replaces the nibtool program.) See ibtool man page.

nm

Displays the symbol tables of one or more object files, including the symbol type and value for each symbol. See nm man page.

otool

Displays specified parts of object files or libraries. See otool or otool64 man page.

pagestuff

Displays information about the specified logical pages of a file conforming to the Mach-O executable format. For each specified page of code, pagestuff displays symbols (function and static data structure names). See pagestuff man page.

pstruct

An alias to c2ph. See pstruct man page.

strings

Looks for ASCII strings in an object file or other binary file. See strings man page.

Performance Tools

Table C-12 lists the applications and command-line tools for analyzing and monitoring performance. For information about performance and the available performance tools, see Performance Overview. These tools are located in <Xcode>/usr/bin and /usr/bin.

Table C-12  Performance tools

Tool

Description

gprof

Produces an execution profile of a C, Pascal, or Fortran77 program. The tool lists the total execution times and call counts for each of the functions in the application, and sorts the functions according to the time they represent including the time of their call graph descendants. See gprof man page.

sample

Gathers data about the running behavior of a process. The sample tool stops the process at user-defined intervals, records the current function being executed by the process, and checks the stack to find how the current function was called. It then lets the application continue. At the end of a sampling session, sample produces a report showing which functions were executing during the session. See sample man page.

top

Displays an ongoing sample of system-use statistics. It can operate in various modes, but by default shows CPU and memory use for each process in the system. See top man page.

Instruction Trace Tools

Table C-13 lists the applications and command-line tools for working with hardware-level programs. These tools are located in /usr/bin.

Table C-13  Instruction trace tools

Tool

Description

acid

Analyzes TT6E (but not TT6) instruction traces and presents detailed analyses and histogram reports. See acid man page.

amber

Captures the instruction and data address stream generated by a process running in Mac OS X and saves it to disk in TT6, TT6E, or FULL format. Custom trace filters can be built using the amber_extfilt.a module in <Xcode>/Examples/CHUD/Amber/ExternalTraceFilter/. Differences between TT6 and TT6E format as well as the specifics of the FULL trace format are detailed in Amber Trace Format Specification v1.1 (<Xcode>/ADC Reference Library/CHUD/AmberTraceFormats.pdf). See amber man page.

simg4

A cycle-accurate simulator of the Motorola 7400 processor that takes TT6 (not TT6E) traces as input. See simg4 man page.

simg5

A cycle-accurate simulator of the IBM 970 processor that takes TT6 (not TT6E) traces as input. See simg5 man page.

Documentation and Help Tools

Table C-14 lists applications and command-line tools for creating or working with documentation and online help. These tools are located in <Xcode>/usr/bin and /usr/bin.

Table C-14  Documentation and help tools

Tool

Description

compileHelp

Merges contextual help RTF snippets into one file. This tool is included to support legacy applications. New contextual help projects do not use this tool. See compileHelp man page.

gatherheaderdoc

Gathers HeaderDoc output, creating a single index page and cross-links between documents. See gatherheaderdoc man page.

headerdoc2HTML

Generates HTML documentation from structured commentary in C, C++, and Objective-C header files. The HeaderDoc tags and scripts are described at http://developer.apple.com/darwin/projects/headerdoc/. See headerdoc2html man page.

install-info

Inserts menu entries from an Info file into the top-level dir file in the GNU Texinfo documentation system. It’s most often run as part of software installation or when constructing a dir file for all manuals on a system. See http://www.gnu.org/software/texinfo/manual/texinfo/ for more information on the GNU Texinfo system. See install-info man page.

Localization Tools

Table C-15 lists the applications and command-line tools for localizing your own applications. These tools are located in <Xcode>/usr/bin and /usr/bin.

Table C-15  Localization tools

Tool

Description

DeRez

Decompiles the resource fork of a resource file according to the type declarations in the type declaration files you specify. You can use this utility to find strings for localization purposes, for example. DeRez works with Resource Manager resource files, not with nib files.

genstrings

Takes the strings from C source code (NSLocalizedString..., CFCopyLocalizedString... functions) and generates string table files (.strings files). This tool can also work with Bundle.localizedString... methods in Java. See genstrings man page.

Rez

Compiles the resource fork of a file according to the textual description contained in the resource description files. You can use Rez to recompile the resource files you decompiled with DeRez after you have localized the strings.

Version Control Tools

Apple provides command-line tools to support several version-control systems. Unless otherwise noted, these tools are located in <Xcode>/usr/bin or /usr/bin.

Subversion

Table C-16 lists the command-line tools to use with the Subversion system.

Table C-16  Subversion tools

Tool

Description

svn

The Subversion command-line client tool. You use this tool for manipulating files in a Subversion archive. See svn man page.

svnadmin

Creates and manages Subversion repositories. See svnadmin man page.

svndumpfilter

Filters data dumped from the repository by a svnadmin dump command. See svndumpfilter man page.

svnlook

Examines repository revisions and transactions. See svnlook man page.

svnserve

Accesses a repository using the svn network protocol. See svnserve man page.

svnversion

Summarizes the revision mixture of a working copy. See svnversion man page.

RCS

Table C-17 lists the command-line tools to use with the RCS system.

Table C-17  RCS tools

Tool

Description

ci

Stores revisions in RCS files. If the RCS file doesn’t exist, ci creates one. See ci man page.

co

Retrieves a revision from an RCS file and stores it in the corresponding working file. See co man page.

rcs

Creates new RCS files or changes attributes of existing ones. See rcs man page.

rcs-checkin

Checks a file into a new RCS file and uses the file’s first line for the description.

rcs2log

Generates a change log from RCS files—which can possibly be located in a CVS repository—and sends the change log to standard output. See rcs2log man page.

rcsclean

Compares the working file to the latest revision (or a specified revision) in the corresponding RCS file and removes the working file if there is no difference. See rcsclean man page.

rcsdiff

Compares two revisions of an RCS file or the working file and one revision. See rcsdiff man page.

rcsmerge

Merges the changes in two revisions of an RCS file into the corresponding working file. See rcsmerge man page.

CVS

Table C-18 lists the command-line tools to use with the Concurrent Versions System (CVS) source control system.

Table C-18  CVS tools

Tool

Description

agvtool

Speeds up common versioning operations for Xcode projects that use the Apple-generic versioning system. It automatically embeds version information in the products produced by the Xcode application and performs certain CVS operations such as submitting the project with a new version number. For more information see the agvtool man page.

cvs

The latest tool for managing information in the CVS repository. (Note, this tool does not support CVS wrappers.) See the cvs man page for details. See also, ocvs below.

cvs-wrap

Wraps a directory into a GZIP format tar file. This single file can be handled more easily by CVS than the original directory.

cvs-unwrap

Extracts directories from a GZIP format tar file created by cvs-wrap.

ocvs

An older version of the cvs tool that still supports CVS wrappers. See the ocvs man page for details.

Comparing Files

Table C-19 lists the command-line tools for comparing files.

Table C-19  Comparison tools

Tool

Description

diff

Compares two files or the files in two directories. See diff man page.

diff3

Compares three files. See diff3 man page.

diffpp

Annotates the output of diff so that it can be printed with GNU enscript. This enables enscript to highlight the modified portions of the file. See diffpp man page.

diffstat

Reads one or more files output by diff and displays a histogram of the insertions, deletions, and modifications per file. See diffstat man page.

merge

Compares two files modified from the same original file and then combines all the changes into a single file. The merge tool warns you if both modified files have changes in the same lines. See merge man page.

opendiff

Opens FileMerge from the command line and begins comparing the specified files. See opendiff man page.

patch

Takes the output of diff and applies it to one or more copies of the original, unchanged file to create patched versions of the file. See patch man page.

sdiff

Compares two files and displays the differences so you can decide how to resolve them interactively. It then writes the results out to a file. A command-line version of FileMerge. See sdiff man page.

Packaging Tools

Table C-20 lists the applications and command-line tools used for packaging applications. These tools are located in <Xcode>/usr/bin and /usr/bin.

Table C-20  Packaging tools

Tool

Description

codesign

Creates a digital code signature for an application or software package. See codesign man page.

CpMac

Copies a file or a directory, including subdirectories, preserving metadata and forks. See CpMac man page.

GetFileInfo

Gets the file attributes of files in an HFS+ directory. See GetFileInfo man page.

install

Copies files to a target file or directory. Unlike the cp or mv commands, the install command lets you specify the new copy’s owner, group ID, file flags, and mode. See install man page.

install_name_tool

Changes the dynamic shared library install names recorded in a Mach-O binary. See install_name_tool man page.

lipo

Can create a multiple-architecture (“fat”) executable file from one or more input files, list the architectures in a fat file, create a single-architecture file from a fat file, or make a new fat file with a subset of the architectures in the original fat file. See lipo man page.

MergePef

Merges two or more PEF files into a single file. PEF format is used for Mac OS 9 code. See MergePef man page.

mkbom

Creates a bill of materials for a directory.

MvMac

Moves files, preserving metadata and forks.

SetFile

Sets the attributes of files in an HFS+ directory. See SetFile man page.

SplitForks

Removes the resource fork in a file or all the resource forks in the files in a specified directory and saves them alongside the original files as hidden files (a hidden file has the same name as the original file, except that it has a “dot-underscore” prefix; for example ._MyPhoto.jpg.). See SplitForks man page.

Scripting Tools

The tools listed in the following sections are located in <Xcode>/usr/bin and /usr/bin.

Interpreters and Compilers

Table C-21 lists the command-line script interpreters and compilers.

Table C-21  Script interpreters and compilers

Tool

Description

awk

A pattern-directed scripting language for scanning and processing files. The scripting language is described on the awk man page.

osacompile

Compiles the specified files, or standard input, into a single script. Input files may be plain text or other compiled scripts. The osacompile command works with AppleScript and with any other OSA scripting language. See osacompile man page.

osascript

Executes a script file, which may be plain text or a compiled script. The osascript command works with AppleScript and with any other scripting language that conforms to the Open Scripting Architecture (OSA). See osascript man page.

perl

Executes scripts written in the Practical Extraction and Report Language (Perl). The man page for this command introduces the language and gives a list of other man pages that fully document it. See perl man page.

perlcc

Compiles Perl scripts. See perlcc man page.

python

The interpreter for the Python language, an interactive, object-oriented language. Use the pydoc command to read documentation on Python modules. See python man page.

ruby

The interpreter for the Ruby language, an interpreted object-oriented scripting language. See ruby man page.

sed

Reads a set of files and processes them according to a list of commands. See sed man page.

tclsh

A shell-like application that interprets Tcl commands. It runs interactively if called without arguments. Tcl is a scripting language, like Perl, Python, or Ruby. However, Tcl is usually embedded and thus called from the Tcl library rather than by an interpreter such as tclsh. See tclsh man page.

Script Language Converters

Table C-22 lists the available command-line script language converters.

Table C-22  Script language converters

Tool

Description

a2p

Converts an awk script to a Perl script. See a2p man page.

s2p

Converts a sed script to a Perl script. See s2p man page.

Perl Tools

Table C-23 lists the available command-line Perl tools.

Table C-23  Perl tools

Tool

Description

dprofpp

Displays profile data generated for a Perl script by a Perl profiler. See dprofpp man page.

find2perl

Converts find command lines to equivalent Perl code. See find2perl man page.

h2ph

Converts C header files to Perl header file format. See h2ph man page.

h2xs

Builds a Perl extension from C header files. The extension includes functions that can be used to retrieve the value of any #define statement that was in the C header files. See h2xs man page.

perlbug

An interactive tool that helps you report bugs for the Perl language. See perlbug man page.

perldoc

Looks up and displays documentation for Perl library modules and other Perl scripts that include internal documentation. If a man page exists for the module, you can use man instead. See perldoc man page.

pl2pm

Aids in the conversion of Perl 4 .pl library files to Perl 5 library modules. This tool is useful if you plan to update your library to use some of the features new in Perl 5. See pl2pm man page.

splain

Forces verbose warning diagnostics by the Perl compiler and interpreter. See splain man page.

Parsers and Lexical Analyzers

Table C-24 lists the available command-line parsers and lexical analyzers.

Table C-24  Parsers and lexical analyzers

Tool

Description

bison

Generates parsers from grammar specification files. A somewhat more flexible replacement for yacc. See bison man page.

flex

Generates programs that scan text files and perform pattern matching. When one of these programs matches the pattern, it executes the C routine you provide for that pattern. See flex man page.

lex

An alias for flex. See lex man page.

yacc

Generates parsers from grammar specification files. Used in conjunction with flex to created lexical analyzer programs. See yacc man page.

Documentation Tools

Table C-25 lists the available command-line scripting documentation tools.

Table C-25  Scripting documentation tools

Tool

Description

pod2html

Converts files from pod format to HTML format. The pod (Plain Old Documentation) format is defined in the perlpod man page. See pod2html man page.

pod2latex

Converts files from pod format to LaTeX format. LaTeX is a document preparation system built on the TeX text formatter. See pod2latex man page.

pod2man

Converts files from pod format to *roff code, which can be displayed using nroff via man, or printed using troff. See pod2man man page.

pod2text

Converts pod data to formatted ASCII text. See pod2text man page.

pod2usage

Similar to pod2text, but can output just the synopsis information or the synopsis plus any options/arguments sections instead of the entire man page. See pod2usage man page.

podchecker

Checks the syntax of documentation files that are in pod format and outputs errors to standard error. See podchecker man page.

podselect

Prints selected sections of pod documentation to standard output. See podselect man page.

Java Tools

The tools listed in the following sections are located in /usr/bin.

General

Table C-26 lists the command-line tools used for building, debugging, and running Java programs.

Table C-26  Java tools

Tool

Description

java

Starts the Java runtime environment and launches a Java application. See java man page.

javac

The standard Java compiler from Sun Microsystems. See javac man page.

jdb

The Java debugger. It provides inspection and debugging of a local or remote Java virtual machine. See jdb man page.

Java Utilities

Table C-27 lists some of the applications and command-line tools for working with Java.

Table C-27  Java utilities

Tool

Description

idlj

Reads an Object Management Group (OMG) Interface Definition Language (IDL) file and translates it, or maps it, to a Java interface. The idlj compiler also creates stub, skeleton, helper, holder, and other files as necessary. These Java files are generated from the IDL file according to the mapping specified in the OMG document OMG IDL to Java Language Mapping Specification, formal, 99-07-53. The idlj compiler is documented at http://java.sun.com/j2se/1.3/docs/guide/rmi-iiop/toJavaPortableUG.html. IDL files are used to allow objects from different languages to interact with a common Object Request Broker (ORB), allowing remote invocation between languages. See idlj man page.

javadoc

Parses the declarations and documentation comments in a set of Java source files and produces HTML pages describing the public and protected classes, inner classes, interfaces, constructors, methods, and fields. See javadoc man page.

javah

Generates C header and source files from Java classes. The generated header and source files are used by C programs to reference instance variables of a Java object so that you can call Java code from inside your Mac OS X native application. See javah man page.

native2ascii

Converts characters that are not in Latin-1 or Unicode encoding to ASCII for use with javac and other Java tools. It also can do the reverse conversion of Latin-1 or Unicode to native-encoded characters. See native2ascii man page.

rmic

A compiler that generates stub and skeleton class files for remote objects from the names of compiled Java classes that contain remote object implementations. A remote object is one that implements the interface java.rmi.Remote. See rmic man page.

rmiregistry

Creates and starts a remote object registry. A remote object registry is a naming service that makes it possible for clients on the host to look up remote objects and invoke remote methods. See rmiregistry man page.

Java Archive (JAR) Files

Table C-28 lists the available JAR file applications and command-line tools.

Table C-28  JAR file tools

Tool

Description

extcheck

Checks a specified JAR file for title and version conflicts with any extensions installed in the Java Developer Kit software. See extcheck man page.

jar

Combines and compresses multiple files into a single Java archive (JAR) file so they can be downloaded by a Java agent (such as a browser) in a single HTTP transaction. See jar man page.

jarsigner

Lets you sign JAR files and verify the signatures and integrity of signed JAR files. See jarsigner man page.

Kernel Extension Tools

Table C-29 lists the command-line tools that are useful for kernel extension development. These tools are located in /usr/sbin and /sbin.

Table C-29  Kernel extension tools

Tool

Description

kextload

Loads kernel extensions, validates them to make sure they can be loaded by other mechanisms, and generates symbol files for debugging them.

kextstat

Displays the status of any kernel extensions currently loaded in the kernel.

kextunload

Terminates and unregisters I/O Kit objects associated with a KEXT and unloads the code for the KEXT.

I/O Kit Driver Tools

Table C-30 lists the applications and command-line tools for developing device drivers. These tools are located in <Xcode>/usr/sbin.

Table C-30  Driver tools

Tool

Description

ioreg

A command-line version of I/O Registry Explorer. The ioreg tool displays the tree in a Terminal window, allowing you to cut and paste sections of the tree.

ioalloccount

Displays a summary of memory allocated by I/O Kit allocators listed by type (instance, container, and IOMalloc). This tool is useful for tracking memory leaks.

ioclasscount

Shows the number of instances allocated for each specified class. This tool is also useful for tracking memory leaks.



< Previous PageNext Page > Hide TOC


© 2004, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-10-15)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.