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
Debugging and Tuning Tools
Documentation and Help Tools
Localization Tools
Version Control Tools
Packaging Tools
Scripting Tools
Java Tools
Kernel Extension Tools
I/O Kit Driver Tools
Apple provides several applications and command-line tools for creating source code files.
Table C-6 lists the command-line compilers, linkers, and build tools. These tools are located in <Xcode>/usr/bin and <Xcode>/Private.
Tool | Description |
|---|---|
The Mac OS X Mach-O assembler. See | |
The BSD make program. See | |
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 | |
The GNU make program. See | |
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. | |
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 | |
A symbolic link to | |
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 | |
Takes an Xcode project ( | |
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 |
Table C-7 lists the command-line tools available for creating libraries. These tools are located in <Xcode>/usr/bin.
Tool | Description |
|---|---|
Takes object files and creates dynamically linked libraries or archive (statically linked) libraries, according to the options selected. The | |
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 | |
Adds to or updates the table of contents of an archive library. See | |
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 | |
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 |
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.
Tool | Description |
|---|---|
Reformats a Fortran file for printing by the UNIX line printer. See | |
Takes a Fortran multiple-routine source-code file and splits it into multiple files, one for each routine. See | |
Scans C source files and writes out a sorted list of all the identifiers that appear in | |
Formats C source code. See | |
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 | |
Can check the syntax of a property list or convert it from one format to another (XML or binary). See | |
Formats and prints character strings and C constants. See | |
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 | |
Takes a compiled resource ( | |
Performs universal search and replace operations on text strings in source files. See | |
Removes | |
Reverses the effects of |
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.
Table C-9 lists the command-line tools available for debugging. These tools are located in <Xcode>/usr/bin and /usr/bin.
Tool | Description |
|---|---|
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 | |
The GNU debugger. You can use it through the Xcode application or can invoke it directly from the command line. See |
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.
Tool | Description |
|---|---|
Lists all the objects currently allocated on the heap of the current process. It also describes any Objective-C objects, listed by class. See | |
Examines a specified process for | |
Inspects a given process and lists the | |
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 | |
Displays Mach virtual memory statistics. See |
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.
Tool | Description |
|---|---|
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 | |
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 | |
Makes a tags file for the | |
Analyzes error messages and can open a text editor to display the source of the error. The | |
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 | |
Displays the symbol tables of one or more object files, including the symbol type and value for each symbol. See | |
Displays specified parts of object files or libraries. See | |
Displays information about the specified logical pages of a file conforming to the Mach-O executable format. For each specified page of code, | |
An alias to | |
Looks for ASCII strings in an object file or other binary file. See |
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.
Tool | Description |
|---|---|
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 | |
Gathers data about the running behavior of a process. The | |
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 |
Table C-13 lists the applications and command-line tools for working with hardware-level programs. These tools are located in /usr/bin.
Tool | Description |
|---|---|
Analyzes TT6E (but not TT6) instruction traces and presents detailed analyses and histogram reports. See | |
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 | |
A cycle-accurate simulator of the Motorola 7400 processor that takes TT6 (not TT6E) traces as input. See | |
A cycle-accurate simulator of the IBM 970 processor that takes TT6 (not TT6E) traces as input. See |
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.
Tool | Description |
|---|---|
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 | |
Gathers HeaderDoc output, creating a single index page and cross-links between documents. See | |
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 | |
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 |
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.
Tool | Description |
|---|---|
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. | |
Takes the strings from C source code ( | |
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. |
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.
Table C-16 lists the command-line tools to use with the Subversion system.
Tool | Description |
|---|---|
The Subversion command-line client tool. You use this tool for manipulating files in a Subversion archive. See | |
Creates and manages Subversion repositories. See | |
Filters data dumped from the repository by a | |
Examines repository revisions and transactions. See | |
Accesses a repository using the | |
Summarizes the revision mixture of a working copy. See |
Table C-17 lists the command-line tools to use with the RCS system.
Tool | Description |
|---|---|
Stores revisions in RCS files. If the RCS file doesn’t exist, | |
Retrieves a revision from an RCS file and stores it in the corresponding working file. See | |
Creates new RCS files or changes attributes of existing ones. See | |
Checks a file into a new RCS file and uses the file’s first line for the description. | |
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 | |
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 | |
Compares two revisions of an RCS file or the working file and one revision. See | |
Merges the changes in two revisions of an RCS file into the corresponding working file. See |
Table C-18 lists the command-line tools to use with the Concurrent Versions System (CVS) source control system.
Tool | Description |
|---|---|
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 | |
The latest tool for managing information in the CVS repository. (Note, this tool does not support CVS wrappers.) See the | |
Wraps a directory into a GZIP format tar file. This single file can be handled more easily by CVS than the original directory. | |
Extracts directories from a GZIP format tar file created by | |
| An older version of the |
Table C-19 lists the command-line tools for comparing files.
Tool | Description |
|---|---|
Compares two files or the files in two directories. See | |
Compares three files. See | |
Annotates the output of | |
Reads one or more files output by | |
Compares two files modified from the same original file and then combines all the changes into a single file. The | |
Opens FileMerge from the command line and begins comparing the specified files. See | |
Takes the output of | |
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 |
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.
Tool | Description |
|---|---|
Creates a digital code signature for an application or software package. See | |
Copies a file or a directory, including subdirectories, preserving metadata and forks. See | |
Gets the file attributes of files in an HFS+ directory. See | |
Copies files to a target file or directory. Unlike the | |
Changes the dynamic shared library install names recorded in a Mach-O binary. See | |
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 | |
Merges two or more PEF files into a single file. PEF format is used for Mac OS 9 code. See | |
Creates a bill of materials for a directory. | |
Moves files, preserving metadata and forks. | |
Sets the attributes of files in an HFS+ directory. See | |
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 |
The tools listed in the following sections are located in <Xcode>/usr/bin and /usr/bin.
Table C-21 lists the command-line script interpreters and compilers.
Tool | Description |
|---|---|
A pattern-directed scripting language for scanning and processing files. The scripting language is described on the | |
Compiles the specified files, or standard input, into a single script. Input files may be plain text or other compiled scripts. The | |
Executes a script file, which may be plain text or a compiled script. The | |
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 | |
Compiles Perl scripts. See | |
The interpreter for the Python language, an interactive, object-oriented language. Use the | |
The interpreter for the Ruby language, an interpreted object-oriented scripting language. See | |
Reads a set of files and processes them according to a list of commands. See | |
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 |
Table C-22 lists the available command-line script language converters.
Tool | Description |
|---|---|
Converts an | |
Converts a |
Table C-23 lists the available command-line Perl tools.
Tool | Description |
|---|---|
Displays profile data generated for a Perl script by a Perl profiler. See | |
Converts find command lines to equivalent Perl code. See | |
Converts C header files to Perl header file format. See | |
Builds a Perl extension from C header files. The extension includes functions that can be used to retrieve the value of any | |
An interactive tool that helps you report bugs for the Perl language. See | |
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 | |
Aids in the conversion of Perl 4 | |
Forces verbose warning diagnostics by the Perl compiler and interpreter. See |
Table C-24 lists the available command-line parsers and lexical analyzers.
Tool | Description |
|---|---|
Generates parsers from grammar specification files. A somewhat more flexible replacement for | |
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 | |
An alias for | |
Generates parsers from grammar specification files. Used in conjunction with flex to created lexical analyzer programs. See |
Table C-25 lists the available command-line scripting documentation tools.
Tool | Description |
|---|---|
Converts files from pod format to HTML format. The pod (Plain Old Documentation) format is defined in the | |
Converts files from pod format to LaTeX format. LaTeX is a document preparation system built on the TeX text formatter. See | |
Converts files from | |
Converts pod data to formatted ASCII text. See | |
Similar to | |
Checks the syntax of documentation files that are in pod format and outputs errors to standard error. See | |
Prints selected sections of pod documentation to standard output. See |
The tools listed in the following sections are located in /usr/bin.
Table C-26 lists the command-line tools used for building, debugging, and running Java programs.
Tool | Description |
|---|---|
Starts the Java runtime environment and launches a Java application. See | |
The standard Java compiler from Sun Microsystems. See | |
The Java debugger. It provides inspection and debugging of a local or remote Java virtual machine. See | |
A Java compiler from IBM, which is faster than |
Table C-27 lists some of the applications and command-line tools for working with Java.
Tool | Description |
|---|---|
Reads an Object Management Group (OMG) Interface Definition Language (IDL) file and translates it, or maps it, to a Java interface. The | |
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 | |
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 | |
Converts characters that are not in Latin-1 or Unicode encoding to ASCII for use with | |
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 | |
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 |
Table C-28 lists the available JAR file applications and command-line tools.
Tool | Description |
|---|---|
Checks a specified JAR file for title and version conflicts with any extensions installed in the Java Developer Kit software. See | |
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 | |
Lets you sign JAR files and verify the signatures and integrity of signed JAR files. See |
Table C-29 lists the command-line tools that are useful for kernel extension development. These tools are located in /usr/sbin and /sbin.
Tool | Description |
|---|---|
Loads kernel extensions, validates them to make sure they can be loaded by other mechanisms, and generates symbol files for debugging them. | |
Displays the status of any kernel extensions currently loaded in the kernel. | |
Terminates and unregisters I/O Kit objects associated with a KEXT and unloads the code for the KEXT. |
Table C-30 lists the applications and command-line tools for developing device drivers. These tools are located in <Xcode>/usr/sbin.
Tool | Description |
|---|---|
A command-line version of I/O Registry Explorer. The | |
Displays a summary of memory allocated by I/O Kit allocators listed by type (instance, container, and | |
Shows the number of instances allocated for each specified class. This tool is also useful for tracking memory leaks. |
Last updated: 2007-10-31