Skip to main content
On this page

Where Is KXBUILD_HOME? Folders and Environment Variables

What's in the KXBUILD_HOME install folder, the keychain and shared folders, what appears in your project folder, and the environment variables you might need.

Last updated

KXBUILD_HOME defaults to %USERPROFILE%\kxbuild on Windows and ~/kxbuild on Linux and macOS. The install script sets it as a user environment variable and adds its bin folder to PATH. The toolchain, iOS SDK, project templates, the machine-wide keychain folder and the sharedcomponents local library all live there, while build output such as the .ipa and DerivedData goes in the project folder and your home folder.

Where is KXBUILD_HOME, and what is in it?

The toolchain lives in one directory, and the KXBUILD_HOME environment variable points to it. The install script sets it for your user and adds bin to PATH. The default is %USERPROFILE%\kxbuild on Windows and ~/kxbuild on Linux and macOS. If the toolchain is somewhere else, set kxbuild.toolchainHome in your VS Code user settings to that directory; it is checked before KXBUILD_HOME and PATH and has no effect in workspace settings.

Folder or fileContents
bin/All executables, including kxbuild, kxdevice, xcodebuild, xcrun and codesign.
Developer/Platforms/SDKs for iOS and other platforms.
Developer/Toolchains/Swift toolchains.
resources/templates/Templates for new projects.
keychain/Certificates, provisioning profiles and password.properties shared by every project on this machine. See Certificates and signing.
sharedcomponents/Local component store. The SDK and toolchain zips put here are installed by doctor instead of being downloaded. See iOS SDK.

Where are the .ipa, DerivedData and compile_commands.json?

LocationDescription
<project dir>/keychain/The project's own certificates. Takes precedence over the global KXBUILD_HOME/keychain. The CODE_SIGN_KEYCHAIN build setting can also point to any folder or a single .p12.
<project dir>/build/<App>.ipaOutput of a Release build.
<project root>/compile_commands.jsonCompiler flags for code completion. The extension keeps it up to date.
~/DerivedData/<name>-<hash>/Build output, including the .app and Swift packages. Change it with --derivedDataDir.
.xcodeproj/project.pbxprojEdited in place by project add-setting, settings apply and the Project Settings Editor. Keep it under version control.

Which environment variables does KXBuild use?

VariablePurpose
KXBUILD_HOMEInstall directory.
KXBUILD_NO_UPDATE_CHECKTurns off new-version prompts and background update checks. Useful in CI.
KXBUILD_SWIFT_WHOLE_MODULEWhich Swift targets are built as a whole module. Applies on Windows and Linux only. The default, packages, covers remote Swift packages only. all covers every Swift target. none compiles everything file by file, like Xcode's default. A target whose project sets Compilation Mode keeps that setting. You can also pass it with -D. Set it to all when linking fails with an undefined …vpfi symbol. See Troubleshooting.
KXBUILD_NODE_DIST_URL, KXBUILD_RUBY_URL, KXBUILD_GEM_SOURCEDownload mirror for Node and Ruby, and the gem source. Useful when downloads are slow. Read only by the install script.
KXBUILD_PROJECT_NAME, KXBUILD_BUNDLE_ID, KXBUILD_PROJECT_DIR, KXBUILD_TEMPLATE_ID, KXBUILD_TEMPLATE_DIR, KXBUILD_BINAvailable to a project template's template.sh. See Project templates.

You rarely need to change files in KXBUILD_HOME by hand. To put certificates in the keychain folder, see how to sign iOS apps on Windows. To install and update SDKs and toolchains, see how to download and install the iOS SDK.

Next steps