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.
Install directory (KXBUILD_HOME)
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.
| Folder or file | Contents |
|---|---|
| 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. An Xcode .xip or the SDK and toolchain zips put here are installed by doctor instead of being downloaded. See iOS SDK. |
Project folder
| Location | Description |
|---|---|
| <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>.ipa | Output of a Release build. The <App>.AppStoreInfo.plist next to it is the asset description used for upload. |
| <project root>/compile_commands.json | Compiler 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.pbxproj | Edited in place by project add-setting, settings apply and the Project Settings Editor. Keep it under version control. |
Environment variables
| Variable | Purpose |
|---|---|
| KXBUILD_HOME | Install directory. |
| KXBUILD_NO_UPDATE_CHECK | Turns off new-version prompts and background update checks. Useful in CI. |
| KXBUILD_SWIFT_WHOLE_MODULE | Which 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_SOURCE | Download 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_BIN | Available to a project template's template.sh. See Project templates. |
Next steps
kxbuild command reference
Every kxbuild subcommand and option, including doctor, build, resolve, project, update and version.
Troubleshooting
Run kxbuild doctor first. Then look up your error message by category: install, project, signing, device, release or extension. Also covers where to find the logs.