Xcode

This is an old revision of Xcode, edited by Trev at . The current revision is 110771.

Rationalised macOS categories

This article applies to macOS only.

See also: Multiplatform Programming Guide

Overview

You do NOT need to install the Xcode IDE in order to get all the build utilities on which the Free Pascal Compiler depends, but you DO need to install the Command Line Tools. How to do so is explained below.

Xcode is an integrated development environment for macOS containing a suite of software development tools developed by Apple for developing software for macOS, iOS, iPadOS, watchOS, and tvOS.

The Command Line Tools Package is a small self-contained package available for download separately from Xcode and that allows you to do command line development in macOS. It consists of the macOS SDK and command-line tools such as Clang, which are installed in the /Library/Developer/CommandLineTools directory.

Installing Command Line Tools: OS X Mavericks 10.9 and higher

You can use any of the following methods to install command line tools on your system:

Install Xcode (includes Command Line Tools)

If you install Xcode, then there is no need to install the command line tools. Xcode comes bundled with all the command line tools. macOS 10.9 and later includes shims or wrapper executables. These shims, installed in /usr/bin, can map any tool included in /usr/bin to the corresponding one inside Xcode. xcrun is one of such shims, which allows you to find or run any tool inside Xcode from the command line. Use it to invoke any tool within Xcode from the command line. For example:

$ xcrun dwarfdump --uuid  MyApp.app/Contents/MacOS/MyApp 
UUID: 4CED1202-EB68-3991-A036-7146FB4D4E17 (x86_64) MyApp.app/Contents/MacOS/MyApp

Install Command Line Tools only

You can install the Command Line Tools package by opening a Terminal and running the following command:

sudo xcode-select --install

macOS comes bundled with xcode-select, a command-line tool that is installed in /usr/bin. It allows you to manage the active developer directory for Xcode and other BSD development tools. See its man page for more information.

In macOS 10.9 and later, software update notifies you when new versions of the command-line tools are available for update.

Installing Command Line Tools: OS X Lion 10.7 or Mountain Lion 10.8

You will need to sign up for a free Apple developer account to login and access the Command Line Tools download. Go to https://developer.apple.com/downloads/ , log in, search for Command Line Tools and download the appropriate file. Mount the DMG file you downloaded and run the package installer.

Legacy Information

Xcode 7.0

1. Change each package debug info. Open Project -> Project Inspector. For each package listed under "Required Packages", double-click on a package (to open package dialog), select "Options" and change debug info type under "Debugging" section

or

2. You can add the setting as a custom option for all packages used in the project. As show in the example on this page. But instead of using "-dSomeValue" put "-gw"

# sudo xcode-select -switch /Applications/Xcode6.4.app

Xcode 5.0

Apple removed "gdb" from it's binary utils. Lazarus is currently only able to use "gdb" as an external debugger. "Gdb" should be installed from the third party. See also GDB on OS X.