Start
Install
What Troupe needs, how to add it to a project, how troupe install prepares each platform, and how
troupe doctor checks the environment.
Requirements
| You need | For | Notes |
|---|---|---|
| macOS on Apple silicon | everything | Linux x86-64 with KVM is planned for Android. Intel Macs and Windows are not supported |
| Bun 1.4.3 or newer | everything | The troupe command is ESM run by Bun. npx and Node cannot run it |
| A full Xcode with an iOS simulator runtime | iOS Simulator | The Command Line Tools alone are not enough |
The Android SDK with emulator, platform-tools and an arm64-v8a system image | Android Emulator | Found through ANDROID_HOME, ANDROID_SDK_ROOT or ~/Library/Android/sdk |
| A logged-in desktop session | Mac Catalyst | Xcode is needed only to build the app |
The platform pages have the details: iOS Simulator, Android Emulator and Mac Catalyst.
Add the package
bun add -d --exact @alivelabs/troupeThis one package is the test framework and the troupe command. It brings the runtime, the client and the
report viewer as dependencies. The platform packages are optional dependencies, loaded only on a host that can
run them.
Bun runs your config and specs as TypeScript directly; there is no build step. Type checking is separate: the
package ships its declarations for your own tsc.
troupe init adds an "e2e": "troupe test" script to package.json, so bun run e2e runs the suite. See the
quick start for troupe init.
Prepare a platform
troupe install prepares a platform once per machine, outside any test:
bunx troupe install ios
bunx troupe install android
bunx troupe install catalystWith no argument it prepares every platform your troupe.config.ts uses, or, without a config, every platform
this host can run. It does four things in order:
- Records the toolchain. Where there is no
~/.troupe/host.json, it writes one that names your Xcode: the one inDEVELOPER_DIR, else/Applications/Xcode.app/Contents/Developer. For Android it records the SDK it finds inANDROID_HOME,ANDROID_SDK_ROOTor~/Library/Android/sdk. The runtime reads these recorded paths from then on, not your shell's environment. - Runs the environment checks for the platform. A failed check prints its fix and the command exits 3.
- Builds what the platform needs ahead. For iOS that is the XCUITest runner and a booted simulator template that devices are cloned from. Android and Mac Catalyst have nothing to build.
- Proves the device path. It starts one device with the device type and OS version of your config's first
project for that platform (or the platform's default), waits until it is ready, and releases it warm. It
then prints
<platform>: a device was ready in <n> s.
The first run can take minutes, because it builds the runner and boots a simulator for the first time.
| Option | What it does |
|---|---|
--no-device | Stops after step 3: no device is started |
--no-daemon | Runs the runtime inside this command for step 4 instead of the daemon. This is also what happens when CI is set |
If your Xcode is not in /Applications/Xcode.app, set DEVELOPER_DIR for the first troupe install, or
set platforms.ios-simulator.developerDir in ~/.troupe/host.json afterwards.
Check the environment
troupe doctor runs the same read-only checks without changing anything:
bunx troupe doctorIt checks the platforms your config uses; --all checks every platform, and so does a directory with no
config. Each line is a status (pass, warn, fail or skip), the check's id, the platform in brackets
and a message. A failed check is followed by a fix: line with one command or one instruction. The command
exits 1 when a check fails; --json prints the result as JSON.
| Checks | Platform | What they cover |
|---|---|---|
host.platform, disk.free, ports.range | all | The host can run the platform, there is free disk space, and Troupe's port range is usable |
xcode.selected, ios.runtimes, ios.runner, ios.home, ios.deviceHub | iOS Simulator | Xcode, an installed simulator runtime, the built runner, where Troupe keeps its files, and other tools attached to Troupe's simulators |
android.sdk, android.emulator, android.images, android.adb, android.driver | Android Emulator | The SDK, the emulator, an installed system image, adb, and Troupe's driver |
gui.session, catalyst.toolchain | Mac Catalyst | A logged-in desktop session and the toolchain |
troupe test runs the checks of the platforms in the run before it starts a device. When one fails, no test
runs and the command exits 3 with every fix printed.
Where Troupe keeps its files
Troupe keeps its state under ~/.troupe, or the directory TROUPE_HOME names:
| Path | What it is |
|---|---|
host.json | The recorded toolchain and this host's settings |
runtime.json | The running daemon's address and token, for tools on this machine |
logs/daemon.log | The daemon's output |
Your project gains test-results/ (traces and attachments), troupe-report/ (the HTML report) and, with the
blob reporter, blob-report/. troupe init adds all three to .gitignore.