Xcode/ru

From Free Pascal wiki
Revision as of 23:16, 25 May 2022 by Zoltanleo (talk | contribs) (Created page with "{{Platform only|macOS}} {{Platform only|iOS}} {{LanguageBar}} == Обзор == {{Note|Вам НЕ НУЖНО устанавливать Xcode IDE, чтобы получит...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
macOSlogo.png

Эта статья относится только к macOS.

См. также: Multiplatform Programming Guide

Apple iOS new.svg

Эта статья относится только к iOS.

См. также: Multiplatform Programming Guide

English (en) русский (ru)

Обзор

Light bulb  Примечание: Вам НЕ НУЖНО устанавливать Xcode IDE, чтобы получить все утилиты сборки, от которых зависит компилятор Free Pascal, но вам НЕОБХОДИМО установить Command Line Tools (CLT - инструменты командной строки). Как это сделать, объясняется ниже. Вам НЕОБХОДИМО установить Xcode, если: (1) вы хотите получить доступ к SDK для iOS, iPadOS, watchOS и tvOS; или (2) для проверки и загрузки приложений в Mac App Store; или (3) для нотариального заверения приложений для распространения за пределами Mac App Store.

Xcode — это интегрированная среда разработки для macOS, содержащая набор инструментов разработки программного обеспечения, разработанных Apple для разработки программного обеспечения для macOS, iOS, iPadOS, watchOS и tvOS.

Автономный пакет инструментов командной строки (Command Line Tools - CLT) — это небольшой автономный пакет, доступный для загрузки отдельно от Xcode, который позволяет вам выполнять разработку командной строки в macOS. Он состоит из macOS SDK и инструментов командной строки, которые устанавливаются в каталоге /Library/Developer/CommandLineTools.

Installing Command Line Tools: Mavericks 10.9 and higher

You can use either of the following methods to install the 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. Mavericks 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

However, you will need to edit your /etc/fpc.cfg file to add this line:

-XR/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

in the "Linking" section which is located towards then end of the file to enable FPC to find the macOS SDK.

Note that this is not the officially supported method nor is it the recommended method for accessing the command line tools and that when you subsequently install FPC, its installer will warn you that the standalone command line tools have not been installed.

Install the standalone Command Line Tools package only

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

sudo xcode-select --install
sudo xcodebuild -license accept

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 Mavericks 10.9 and later, software update notifies you when new versions of the command-line tools are available for update.

Note that installing the standalone command line tools, and not also installing Xcode, will only provide you with the SDK for macOS (you will not have the SDKs for iOS, iPadOS, watchOS or tvOS).

Installing Command Line Tools: 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

  • If after updating to Xcode 7 your projects fail to compile and you are using FPC 2.6.4 (or earlier), change your debug info type from "Automatic" to "Dwarf". Apple's assembler no longer supports .Stabs debug information (which is used by default on i386).
    • If your project is using packages you might need to switch these packages debug info to Dwarf as well. There're two ways to do that.
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"
  • Alternatively you could download the previous version 6.4
    • Download Xcode 6.4, and change the folder name to Xcode6.4 before copy to /Application
    • So you have two Xcode applications now, so switch your command line tools to using the ones from Xcode6.4:
# sudo xcode-select -switch /Applications/Xcode6.4.app
  • more to come for ARM (iOS) target.

Xcode 5.0

Apple removed "gdb" from it's binary utilities. At the time, Lazarus was only able to use "gdb" as an external debugger. "Gdb" should be installed from a third party. See GDB on macOS.

External links