Xcode command-line tool reference
Use command-line tools that require you to install Xcode and set the app as the active developer directory.
Overview
Xcode includes a set of command-line tools that only ship with the app, such as devicectl, simctl, and xcodebuild. You must install and set Xcode as the active developer directory before you can invoke these commands in Terminal.
Automate build and version numbers
agvtoolManage build and version numbers. To learn more about this command, enter
man agvtoolin Terminal.
Build a project
xcodebuildBuild Xcode projects and workspaces. To learn more about this command, enter
man xcodebuildin Terminal.
Debug a project
devicectlManage and interact with devices connected to a host. To learn more about this command, enter
xcrun devicectl helpin Terminal.xcdebugStart a debugging session in Xcode. To learn more about this command, enter
xcdebug --helpin Terminal.
Edit files
xedOpen files in the Xcode app. To learn more about this command, enter
man xedin Terminal.
Identify and merge changes
opendiffUse FileMerge to graphically compare or merge files or directories. To learn more about this command, enter
man opendiffin Terminal.
Inspect result bundles
xcresulttoolRead result bundles. To learn more about this command, enter
man xcresulttoolin Terminal.
Manage Instruments files
xctraceRecord, import, export and symbolicate Instruments
.tracefiles. To learn more about this command, enterman xctracein Terminal.
Manage scripting definition
desdpGenerate scripting definition (“sdef”). To learn more about this command, enter
man desdpin Terminal.sdefExtract scripting definition (“sdef”). To learn more about this command, enter
man sdefin Terminal.sdpProcess scripting definition (“sdef”). To learn more about this command, enter
man sdpin Terminal.
Manage the interface
actoolCompile, print, update, and verify asset catalogs. To learn more about this command, enter
man actoolin Terminal.ibtoolCompile, print, update, and verify Interface Builder documents. To learn more about this command, enter
man ibtoolin Terminal.xcstringstoolGenerate string tables from source code. To learn more about this command, enter
xcrun xcstringstool helpin Terminal.
Manage the Simulator
simctlControl the Simulator. To learn more about this command, enter
xcrun simctl helpin Terminal.