# Windows Setup

> Set up a Windows machine to build Titanium apps for Android.

- Source: https://titaniumsdk.com/docs/setup/windows
- Applies to: Windows, Android
- Written for Titanium SDK 13.4.0 and later.
- This corpus documents Titanium SDK 13.4.1. Anything here that does not name a version describes 13.4.1.
- Titanium is maintained by TiDev. The Appcelerator toolchain is retired: there is no `appc` CLI, no Appcelerator Studio and no hosted build service. The supported CLI is `titanium` on npm, invoked as `ti`.

---

Run the commands below in PowerShell.

## Install Node.js

Titanium requires **Node.js 22.19.0 or 24.x**.

> [!IMPORTANT]
> **Node 26 is only compatible with Titanium SDK 14 or newer.** Node 24
> works with every SDK.

**winget**

```powershell
winget install OpenJS.NodeJS.LTS
```

`.LTS` follows whatever is LTS at the time, so confirm the version below.

**nvm**

```powershell
winget install CoreyButler.NVMforWindows
```

Reopen PowerShell as Administrator, then:

```powershell
nvm install 24
nvm use 24
```

**Installer**

Download the `.msi` from [nodejs.org](https://nodejs.org/dist/latest-v24.x/).

```sh
node -v
```

## Install a JDK

Titanium requires **JDK 17, 21, or 25**. JDK 26 is only compatible with
Titanium SDK 14 or newer.
Any distribution works. The commands below install
[Temurin](https://adoptium.net/) or your distribution's OpenJDK.

**winget**

```powershell
winget install EclipseAdoptium.Temurin.21.JDK
```

**Installer**

Download the `.msi` from
[Adoptium](https://adoptium.net/temurin/releases/?version=21).

```sh
javac -version
```

## Set `JAVA_HOME`

Gradle and the Titanium SDK locate the JDK through `JAVA_HOME`. Most installers
leave it unset.

```powershell
[Environment]::SetEnvironmentVariable(
  'JAVA_HOME',
  (Get-Item (Get-Command javac).Source).Directory.Parent.FullName,
  'User'
)
```

Reopen PowerShell, then:

```powershell
& "$env:JAVA_HOME\bin\javac" -version
```

## Install the Titanium CLI

**npm**

```sh
npm install -g titanium
```

**pnpm**

```sh
pnpm add -g titanium
```

```sh
ti -v
```

The command is also available as `titanium`:

```sh
titanium -v
```

## Install the Titanium SDK

The CLI is the tool you run; the SDK is what builds your app. You can have
several SDKs installed at once.

```sh
ti sdk install
```

With no version, that installs the latest stable release and makes it the
default. It is a few hundred megabytes.

```sh
ti sdk list
ti sdk list --releases
```

## Install the Android SDK

Titanium needs four pieces of it:

| Component      | Why                   | Supported by SDK 13.4 |
| -------------- | --------------------- | --------------------- |
| SDK Platform   | Compiles against it   | API 23 to 36          |
| Build Tools    | Packages the APK      | 30.0.2 to 35.x        |
| Platform Tools | Provides `adb`        | 33.x                  |
| Emulator       | Runs a virtual device | Any current version   |

Android Studio is the straightforward way to get them. The command-line tools
are smaller and are what you want on a build server.

**Android Studio**

Install [Android Studio](https://developer.android.com/studio) and let the setup
wizard run. It installs a platform, build tools and platform tools.

Then open **Settings → Languages & Frameworks → Android SDK** and check that
**SDK Tools** lists **Android SDK Build-Tools**, **Android SDK Platform-Tools**
and **Android Emulator**.

**Command line**

Download the **command-line tools** from the
[Android Studio downloads page](https://developer.android.com/studio#command-line-tools-only)
and unzip them to `<sdk>/cmdline-tools/latest`. The tools expect that exact
layout and fail confusingly without it.

```sh
sdkmanager "platforms;android-36" "build-tools;35.0.0" "platform-tools" "emulator"
```

> [!NOTE]
> Google has deprecated `sdkmanager` in favour of `android sdk install
platforms/android-36 build-tools/35.0.0`. Both work. `sdkmanager` still ships
> in the command-line tools and is what most CI scripts call.

## Set the Android SDK path

```sh
ti setup android
```

`ti setup android` finds the SDK and writes the path to the CLI's config, so no
environment variable has to be right.

If you would rather set one, Titanium checks `ANDROID_SDK_ROOT` and
`ANDROID_SDK`, then looks for `adb` on your `PATH`, then scans the usual install
directories.

> [!IMPORTANT]
> `ANDROID_HOME` is not one of them. Most Android documentation tells you to set
> it; Titanium's app build does not read it.

## Versions newer than Titanium supports

Google ships API levels and build tools faster than the SDK adds support, so a
current Android Studio usually produces warnings:

```
!  Android API Android 17 (android-37) is too new and may or may not work with
   Titanium SDK 13.4.0.
   The maximum supported Android API level by Titanium SDK 13.4.0 is API level 36.
```

Titanium builds anyway. Leave them until a build fails, then pin a version it
knows:

```sh
ti config android.buildTools.selectedVersion 35.0.0
```

Android Studio installs the SDK to `%LOCALAPPDATA%\Android\Sdk`, which the CLI
already checks.

> [!IMPORTANT]
> Do not put the SDK anywhere with a space or an ampersand in the path. Titanium
> checks for ampersands and refuses to build, because the Android build tools
> mis-parse them. That rules out `C:\Program Files`.

## Set up an emulator

The emulator needs hardware acceleration: either Windows Hypervisor Platform or
Intel HAXM. Android Studio's setup wizard enables whichever applies.

If it will not start, enable **Windows Hypervisor Platform** in _Turn Windows
features on or off_, reboot, and try again.

A physical device over USB is faster. It needs USB debugging turned on in
Developer options and the vendor's USB driver.

## Verify Titanium is Ready

```sh
ti info
```

![A macOS terminal running ti info. It opens with the Titanium CLI and SDK versions, then lists what it detected under headings: Operating System, with the name, version, architecture, CPU count and memory; Node.js, with the Node.js and npm versions; Titanium CLI, with the CLI version; and the start of the installed Titanium SDKs.](https://titaniumsdk.com/docs/guides/ti-info-macos.png)

`ti info` lists everything it detected and any issues it found. A working setup
reports none.

Warnings are common and usually harmless: a component newer than the SDK
supports produces one, and so does a missing NDK. When something is wrong,
`ti info` names it and says what to do.

## Troubleshooting

### `ti` is not recognised as a command

Reopen PowerShell. A fresh install does not affect a shell that was already
running. If it still fails, check that npm's global directory is on your `PATH`:

```powershell
npm config get prefix
```

### `ti info` cannot find the Android SDK

Run `ti setup android` and give it the path. If you set `ANDROID_HOME` and
expected it to work, use `ANDROID_SDK_ROOT` instead.

### The build fails complaining about the SDK path

Check the path for spaces and ampersands. Moving the SDK is the only fix.

### A build fails partway through with a file-in-use error

Antivirus scanning the build directory. Exclude your project's `build`
directory from real-time scanning.

## Next

[Your first app](https://titaniumsdk.com/docs/build/first-app.md) creates a project and builds it.
