SDK Manager

From RAD Studio
Jump to: navigation, search

Go Up to Deploying Applications Overview


Tools > Options > Deployment > SDK Manager

In the Projects Window, right-click a platform in Target Platforms and click Edit SDK

Displays the existing SDKs, and enables you to add and manage SDKs for macOS, iOS, and Android.

What an SDK Does

A software development kit (SDK) provides the software required to build your applications for a target platform. In the SDK Manager page, an SDK provides the information that RAD Studio needs to locate the required software in your system.

macOS and iOS SDKs provide:

  • A list of absolute paths to files and folders on the Mac that are required to build applications for the SDK target platform.
  • A copy of those files, which can be pulled from the Mac using a connection profile.

Android SDKs contain the paths to the required software in your system.

On the SDK Manager page, for each target platform that has an associated SDK, one SDK is the default SDK, which appears in bold type. Windows platforms do not have a default SDK.

When You Must Add an SDK

SDKs are required for the following platforms and application types:

  • C++ multi-device applications for the macOS platform.
  • Multi-device applications for the iOS Device - 32 bit platform.
  • Multi-device applications for the iOS Device - 64 bit platform.
  • Multi-device applications for the Android platform.
Note: If your Android SDK and NDK are installed by the RAD Studio installer, the installed locations are known to the SDK Manager. In this case, the SDK fields should be auto-populated, and you do not need to add an SDK for your Android apps.

File Names and File Extension for SDKs

SDK names have few restrictions other than that they must be valid filenames, as determined by System.IOUtils.TPath.HasValidFileNameChars. Duplicated SDK names result in an error (from the attempted Add or Import).

The SDK file extension is .sdk, which is added automatically when the SDK is saved as a file.

Examples of names for an SDK:

  • MyFirstOSXSdk
  • Gr8daZ!

Each SDK you have defined is saved as an .sdk file in your Application Data folder (as returned by DesignIntf.IDesigner170.GetAppDataDirectory), such as the following folder on Windows 7:

C:\Users\<username>\AppData\Roaming\Embarcadero\BDS\21.0

The file contains the information about the SDK, such as the paths to the software required to build applications for the SDK target platform.

The actual SDK files (the SDK local file cache) are stored by default in C:\Users\<user>\Documents\Embarcadero\Studio\SDKs.

To change the SDK local file cache location of an SDK:

SDK Panel

Item Description

SDK versions

Lists the SDKs that have been defined, along with their associated platform. Boldface indicates the default SDK for a platform.

  • To set a default SDK for a platform, do either of the following:
    • Right-click the SDK entry and select Set as Default.
    • Double-click the SDK entry.
  • To edit an SDK, select it in the SDK versions list, make changes to the SDK Properties, and then click Save (without the Save, your changes are not saved).

Clicking one of the SDKs enables the buttons for managing an SDK (Delete and Export).

SDK Properties

Displays the current settings in the selected SDK.

The content of this frame depends on the SDK platform: macOS, iOS or Android.

macOS and iOS SDK Properties

These are the fields that you can see in the SDK Properties frame when you select a macOS or iOS SDK.

Local root directory

Displays the directory on the local machine where files from the remote machine are cached. The default value is:

$(BDSPLATFORMSDKSDIR)\<sdk-name>

The value for the variable $(BDSPLATFORMSDKSDIR) is set on Tools > Options > IDE > Environment Variables

For C++, this directory is specified to the compiler with the --sysroot option. The remote paths are implicitly prefixed with the local root directory.

You can set the current values as the new default values by clicking SavePaths.png Save paths as the default for selected platform in the Remote paths pane.

Remote paths

Displays the list of paths on the remote machine that are pulled to the local machine.

A remote path is made up of:

  • Directory. Represents the directory on the target or intermediate platform.
  • File mask. Represents either the file name (for a single file) or the * (asterisk) wildcard, which matches all files in the specified directory. Example: OpenGL.
  • Subdirectories. Indicates whether to include subdirectories.

There are four categories of remote paths, and the category determines how the paths/items are passed to the C++ compiler and linker, as follows:

  • Include paths are passed to the compiler as part of the --sysinc path (the system include file search path with root directory prepended).
  • Library paths are passed to the linker as part of the --syslib path (the system library search path with root directory prepended).
  • Frameworks are passed to the compiler (with the --framework option) and to the linker (with the --Ff option).
  • Other paths are not passed to the compiler/linker by default, but are pulled to the local machine.

All items specified are pulled to the local machine. See PAClient.

All paths should use the style appropriate for the target host machine. For example, use forward slashes (/) as separators for paths on Mac hosts. Certain punctuation marks such as the tilde (~) should be recognized for Mac.

The buttons on the Remote Paths field are described below:

Button Description

New.png Add a new path item

Displays the Add Remote Path Item dialog box. You can also add a new SDK by pressing the Insert key on the keyboard while the Remote paths list is in focus.

EditPathItem.png Edit the selected path item

Displays the Edit Remote Path Item dialog box.

DeletePathItem.png Delete the selected path item

Displays a confirmation dialog box and, if accepted, deletes the selected path item. You can also delete a path by pressing the Delete key on the keyboard while the Remote paths list is in focus and a path item is selected.

ResetPaths.png Reset paths to defaults for the selected platform

Displays a confirmation dialog box, and, if accepted, overwrites all path items with the default SDK's values for the selected platform. Includes the Local root directory only if it is blank.

The values being restored are determined as follows:

  • If you have not reset the defaults, the values are the RAD Studio default values.
  • After you reset the defaults, the new values become the default values and are stored in the <platform>.defaultsdkpaths file in your C:\Users\<username>\AppData\Roaming\Embarcadero\BDS\21.0 directory. So clicking ResetPaths.png restores the new defaults you created.
  • To restore the original defaults, delete the .defaultsdkpaths file for the target platform. The original default paths now appear on your new SDKs.

SavePaths.png Save paths as defaults for selected platform

Overwrites all default path items with the specified SDK value path items for the selected platform. After you save paths as defaults, the new values you enter here are the ones that are restored when you click ResetPaths.png (Reset paths to defaults).

When you save default paths, a file is created for the defaults. The file name is the platform name with a .defaultsdkpaths extension.

For example:

Macintosh macOS

OSX32.defaultsdkpaths

Win32

Win32.defaultsdkpaths

Win64

Win64.defaultsdkpaths

To abandon your settings and restore the original defaults, first delete the .defaultsdkpaths file located in the directory that %APPDATA% expands to (that is, C:\Users\<username>\AppData\Roaming\Embarcadero\BDS\21.0) and then click ResetPaths.png (Reset paths to defaults).

UpArrow.png Up Button

Moves the selected path item up within its path group. You can also move an item up by pressing the Ctrl+Up-Arrow key combination on the keyboard while the Remote paths list is in focus.

DownArrow.png Down Button

Moves the selected path item down within its path group. You can also move an item down by pressing the Ctrl+Down-Arrow key combination on the keyboard while the Remote paths list is in focus.

Update Local File Cache

Prompts you for a connection profile, and uses the selected connection profile to pull all of the specified files to the local (development) machine from the remote target machine. Only files with different sizes or timestamps than those files already in the SDK local file cache are pulled. A progress dialog is shown when pulling, giving you the opportunity to cancel the process. You are also prompted before any local files are overwritten.

You should click this button after you make changes to paths on the SDK Manager dialog box.

Add

Launches the Add a New SDK dialog box so that you can add an SDK for a target platform using a connection profile. The keyboard equivalent is pressing the Insert key on the keyboard while the SDKs list is in focus.

Delete

Prompts you for confirmation and, if accepted, deletes the currently selected SDK. You can also delete an SDK by pressing the Delete key on the keyboard while the SDKs list is in focus.

Export

Prompts you for a filename and saves the SDK settings to that location (the default file name is "<sdk-name>.sdk").

Import

Prompts you for a .sdk filename and imports the contained SDK settings into the IDE.

Android SDK, NDK and Java Properties

These are the fields that you can see in the Properties pane when you select an Android SDK. The Properties pane provides three tabs: SDK, NDK and Java.

SDK Tab

Item Description

SDK base path

The location of the Android SDK folder.

For RAD Studio to recognize your Android SDK folder as a valid Android SDK folder, this folder must contain a tools subfolder, and this subfolder must contain a source.properties file. The source.properties file defines the version (Pkg.Revision) of your Android SDK.

ZipAlign location

The location of the ZipAlign.exe SDK tool.

For example:

  • <Android SDK base path>\tools\ZipAlign.exe
  • <Android SDK base path>\build-tools\<version>\zipalign.exe

Android location

The location of the Android.bat SDK tool.

Adb location

The location of the Adb.exe SDK platform tool.

Aapt location

The location of the aapt.exe SDK build tool.

SDK API-Level location

The location of the SDK API level folder to use. Any version is fine (for example, <SDK folder>\platforms\android-17).

For RAD Studio to recognize your SDK API-level folder as a valid folder, this folder must contain an android.jar file.

NDK Tab

Item Description

NDK base path

The location of the Android NDK folder.

arm-linux-androideabi-ld.exe location

The location of the arm-linux-androideabi-ld.exe linker (for example, <NDK folder>\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin).

arm-linux-androideabi-strip.exe location

The location of the arm-linux-androideabi-strip.exe executable (for example, <NDK folder>\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin).

RAD Studio uses this executable to reduce the size of your Android application packages.

gdbserver location

The location of the GDB server within the Android NDK folder (for example, <NDK folder>\prebuilt\android-arm\gdbserver).

NDK API location

The location of the API folder within the Android NDK folder (for example, <NDK folder>\platforms\android-14).

For RAD Studio to recognize your NDK API folder as a valid folder, this folder must contain a file at arch-arm\usr\lib\libandroid.so.

C++Builder NDK Library path

The location of the C++ library folder within the Android NDK folder (for example, <NDK folder>\platforms\android-14\arch-arm\usr\lib).

Click the ellipsis (ProjectOptionsEllipsis.jpg) to open Directories if you want to add, replace or delete new library paths.

Delphi NDK Library path

The location of the Delphi library folder within the Android NDK folder (for example, <NDK folder>\sources\cxx-stl\stlport\libs\armeabi-v7a).

Click the ellipsis (ProjectOptionsEllipsis.jpg) to open Directories if you want to add, replace or delete new library paths.

Java Tab

Item Description

KeyTool location

The location of the KeyTool.exe JDK tool.

JarSigner location

The location of the JarSigner.exe JDK tool.

Note: You cannot use network addresses starting with a double backslash as locations in the Android SDK properties. For example, \\mycompany.com\android\sdk is not a valid value here. Use a network drive instead.

Troubleshooting (macOS and iOS)

Handling Multiple Xcode Installations

If you have more than one installation of Xcode, you must make sure that the xcode-select command-line tool points to your main Xcode installation folder. Type xcode-select -p to see the path to the currently selected developer directory:

MacOS yourname $ xcode-select -p
/Applications/Xcode.app/Contents/Developer

If the command-line tool points to a folder that is not your main Xcode installation folder, type xcode-select -s <path> to set the developer directory, such as:

MacOS yourname $ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

For further information, see the Apple documentation for xcode-select.

Missing SDK Versions Because the Xcode Directory Is Wrong

After you select a connection profile on the Add a New SDK dialog box, the Select an SDK version drop-down is filled with the SDK versions detected by the Platform Assistant on the remote machine.

If the Select an SDK version drop-down list is empty, an expected SDK version is not listed, or you get the following error:

No SDKs could be found for the iOS Device/Simulator platform. Did you install the Command Line Tools on your Xcode?

Check your Xcode installation on your Mac, and make sure that the xcode-select command-line tool points to your Xcode installation folder. See Handling Multiple Xcode Installations.

If the path pointed by xcode-select is correct, check the contents of the following directory:

<Xcode developer directory>/Platforms/<platform>.platform/Developer/SDKs/
Such as: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

where platform is:

  • MacOSX for the macOS platform
  • iPhoneOS for the iOS Device - 32 bit and iOS Device - 64 bit platforms
  • iPhoneSimulator for the iOS Simulator platform

The Platform Assistant reads the SDK versions from that directory, and the Select an SDK version drop-down list contains only those SDK versions.

Note: The Platform Assistant provides an additional SDK, Command Line Tools, that you need to install for the macOS platform only.

"UnKnown Compiler" Error After Updating XCode

[bccosx Fatal Error]... unKnown Compiler error might happen after updating XCode on macOS.

To solve this problem follow the steps:

  • Delete the SDK from the SDK Manager.
    • Go to Tools > Options > Deployment > SDK Manager
      Note: You can also access the SDK Manager by going to Projects Window
    • Select the SDK version under the macOS section and click Delete.
  • Remove all the content from the SDK folder on the machine where RAD Studio is installed.
    • The SDK folder is located at Documents\Embarcadero\Studio\SDKs\.
  • Remove the scratch-dir folder located at the PAServer directory on the macOS.

Once you perform all the steps, launch again the application to add a new SDK.

Topics

See Also