Complete reference for configuring the Android, iOS, and React Native devbox plugins through devbox.json.
{
"include": ["github:segment-integrations/devbox-plugins?dir=plugins/android"]
}{
"include": ["github:segment-integrations/devbox-plugins?dir=plugins/ios"]
}The React Native plugin automatically includes both Android and iOS plugins:
{
"include": ["github:segment-integrations/devbox-plugins?dir=plugins/react-native"]
}ANDROID_USER_HOME- Android user home directory (default:{{ .Virtenv }}/android)ANDROID_AVD_HOME- AVD home directory (default:{{ .Virtenv }}/android/avd)ANDROID_EMULATOR_HOME- Emulator home directory (default:{{ .Virtenv }}/android)ANDROID_CONFIG_DIR- Configuration directory (default:{{ .DevboxDir }})ANDROID_DEVICES_DIR- Device definitions directory (default:{{ .DevboxDir }}/devices)ANDROID_SCRIPTS_DIR- Runtime scripts directory (default:{{ .Virtenv }}/scripts)ANDROID_RUNTIME_DIR- Runtime directory (default:{{ .Virtenv }})
ANDROID_DEFAULT_DEVICE- Default device name when none specified (default:max)ANDROID_DEVICES- Comma-separated device names to evaluate (empty = all devices, default:"")ANDROID_DEVICE_NAME- Override device selection for current commandTARGET_DEVICE- Alternative device selection (deprecated, useANDROID_DEVICE_NAME)
ANDROID_LOCAL_SDK- Use local SDK instead of Nix-managed SDK (0=false, 1=true, default:0)ANDROID_COMPILE_SDK- Compile SDK version (default:36)ANDROID_TARGET_SDK- Target SDK version (default:36)ANDROID_BUILD_TOOLS_VERSION- Build tools version (default:36.1.0)ANDROID_CMDLINE_TOOLS_VERSION- Command-line tools version (default:19.0)ANDROID_SYSTEM_IMAGE_TAG- System image tag (default:google_apis)- Valid values:
google_apis,google_apis_playstore,play_store,aosp_atd,google_atd
- Valid values:
ANDROID_INCLUDE_NDK- Include Android NDK in SDK (true/false, default:false)ANDROID_NDK_VERSION- NDK version when enabled (default:27.0.12077973)ANDROID_INCLUDE_CMAKE- Include CMake in SDK (true/false, default:false)ANDROID_CMAKE_VERSION- CMake version when enabled (default:3.22.1)
ANDROID_APP_APK- Path or glob pattern for APK (relative to project root)ANDROID_APP_ID- Android application ID (e.g.,com.example.app)ANDROID_BUILD_CONFIG— Build configuration: Debug or Release (default:Debug)ANDROID_BUILD_TASK— Gradle task override (empty = auto-derive from config, e.g., assembleDebug)
EMU_HEADLESS- Run emulator headless without GUI window (0/1)EMU_PORT- Preferred emulator port (default:5554)ANDROID_EMULATOR_PURE- Always start fresh emulator with clean state (0/1, default:0)ANDROID_SKIP_CLEANUP- Skip offline emulator cleanup during startup (0/1, default:0)- Set to 1 in multi-emulator scenarios to prevent cleanup from killing emulators that are still booting
ANDROID_DISABLE_SNAPSHOTS- Disable snapshot boots, force cold boot (0/1, default:0)
ANDROID_SKIP_SETUP- Skip Android SDK downloads/evaluation during shell initialization (0/1, default:0)- Useful for iOS-only contexts in React Native projects to speed up initialization
- When set to 1, skips Nix flake evaluation, SDK resolution, and environment configuration
- Set before shell initialization:
devbox run -e ANDROID_SKIP_SETUP=1 build:ios - With --pure flag:
devbox run --pure -e ANDROID_SKIP_SETUP=1 build:ios
REPORTS_DIR- Base reports directory (default:reports)TEST_LOGS_DIR- Test logs directory (default:reports/logs)TEST_RESULTS_DIR- Test results directory (default:reports/results)
The Android plugin automatically includes:
bash@latestcoreutils@latestgnused@latestgnugrep@latestgawk@latestjq@latestprocess-compose@latest
android:devices:eval- Generate lock file from device definitionsstart:emu- Start Android emulatorstop:emu- Stop Android emulatorreset:emu- Reset Android emulator
doctor- Check Android environment healthverify:setup- Quick verification that Android environment is functional (exits 1 on failure)
The Android plugin runs two initialization hooks:
init-hook.sh- Pre-shell initialization (generates lock file, sets up flake)setup.sh- Shell environment setup (configures PATH and environment variables)
{
"include": ["github:segment-integrations/devbox-plugins?dir=plugins/android"],
"packages": {
"jdk17": "latest",
"gradle": "latest"
},
"env": {
"ANDROID_DEFAULT_DEVICE": "max",
"ANDROID_DEVICES": "min,max",
"ANDROID_APP_ID": "com.example.devbox",
"ANDROID_APP_APK": "app/build/outputs/apk/debug/app-debug.apk",
"ANDROID_COMPILE_SDK": "36",
"ANDROID_TARGET_SDK": "36"
},
"shell": {
"scripts": {
"build": [
"gradle assembleDebug"
],
"build:release": [
"gradle assembleRelease"
],
"start:app": [
"android.sh run ${1:-${ANDROID_DEFAULT_DEVICE:-max}}"
]
}
}
}IOS_CONFIG_DIR- Configuration directory (default:{{ .DevboxDir }})IOS_DEVICES_DIR- Device definitions directory (default:{{ .DevboxDir }}/devices)IOS_SCRIPTS_DIR- Scripts directory (default:{{ .Virtenv }}/scripts)
IOS_DEFAULT_DEVICE- Default device name when none specified (default:max)IOS_DEVICES- Comma-separated device names to evaluate (empty = all devices, default:"")IOS_DEFAULT_RUNTIME- Default iOS runtime version (empty = latest available)
IOS_DEVELOPER_DIR- Xcode developer directory path (empty = auto-detect)IOS_XCODE_ENV_PATH- Additional PATH entries for Xcode toolsIOS_DOWNLOAD_RUNTIME- Auto-download missing runtimes (1=yes, 0=no, default:1)
IOS_APP_ARTIFACT- Path or glob pattern for .app bundle (relative to project root; empty = auto-detect via xcodebuild + search)IOS_APP_SCHEME— Xcode scheme override (empty = auto-detect from project filename)IOS_APP_PROJECT— Explicit .xcworkspace or .xcodeproj path (empty = auto-detect)IOS_BUILD_CONFIG— Build configuration: Debug or Release (default:Debug)IOS_DERIVED_DATA_PATH— DerivedData directory path (default:{{ .Virtenv }}/DerivedData)
IOS_SKIP_SETUP- Skip iOS environment setup during shell initialization (1=skip, 0=setup, default:0)- Useful for Android-only contexts in React Native projects to speed up initialization
- When set to 1, skips Xcode path detection, device lock generation, and environment configuration
REPORTS_DIR- Base reports directory (default:reports)
These are set automatically by the plugin:
DEVELOPER_DIR- Xcode developer directory (used by xcrun, xcodebuild)CC- C compiler path (/usr/bin/clang)CXX- C++ compiler path (/usr/bin/clang++)IOS_NODE_BINARY- Node.js binary path (if available, for React Native)
Set during simulator/app operations:
IOS_SIM_UDID- UUID of running simulatorIOS_SIM_NAME- Name of running simulator
The iOS plugin automatically includes:
bash@latestcoreutils@latestgnused@latestgnugrep@latestgawk@latestjq@latestprocess-compose@latestcocoapods@latest(macOS only: x86_64-darwin, aarch64-darwin)
start:sim- Start iOS simulatorstop:sim- Stop iOS simulator
ios:devices:eval- Generate lock file from device definitions
doctor- Check iOS environment healthverify:setup- Quick verification that iOS environment is functional (exits 1 on failure)
The iOS plugin runs two initialization hooks:
init-hook.sh- Pre-shell initialization (generates lock file)setup.sh- Shell environment setup (configures PATH and environment variables)
{
"include": ["github:segment-integrations/devbox-plugins?dir=plugins/ios"],
"packages": {
"process-compose": "latest"
},
"env": {
"IOS_DEFAULT_DEVICE": "max",
"IOS_DEVICES": "min,max"
},
"shell": {
"scripts": {
"build:ios": [
"ios.sh xcodebuild -scheme MyApp -configuration Debug -destination 'generic/platform=iOS Simulator' build"
],
"build:release": [
"ios.sh xcodebuild -scheme MyApp -configuration Release build"
],
"start:app": [
"ios.sh run ${1:-}"
]
}
}
}The React Native plugin composes both Android and iOS plugins. All Android and iOS environment variables are available.
REACT_NATIVE_CONFIG_DIR- Configuration directory (default:{{ .DevboxDir }})REACT_NATIVE_VIRTENV- Virtual environment directory (default:{{ .Virtenv }})REACT_NATIVE_SCRIPTS_DIR- Scripts directory (default:{{ .Virtenv }}/scripts)REACT_NATIVE_WEB_BUILD_PATH- Web build output path (default:web/build)
METRO_CACHE_DIR- Metro cache directory (default:{{ .Virtenv }}/metro/cache)RN_METRO_PORT_START- Metro port range start (default:8091)RN_METRO_PORT_END- Metro port range end (default:8199)
The React Native plugin overrides some Android default values:
ANDROID_DEVICES- Empty by default (evaluate all devices)IOS_DEVICES- Empty by default (evaluate all devices)ANDROID_COMPILE_SDK- Set to35ANDROID_TARGET_SDK- Set to35ANDROID_BUILD_TOOLS_VERSION- Set to35.0.0ANDROID_INCLUDE_NDK- Set totrueANDROID_NDK_VERSION- Set to29.0.14206865ANDROID_INCLUDE_CMAKE- Set totrueANDROID_CMAKE_VERSION- Set to4.1.2
The React Native plugin includes all packages from Android and iOS plugins, plus:
nodejs@20watchman@latestprocess-compose@latest
rn:metro:port- Get Metro port for a test suitern:metro:clean- Clean Metro cache for a test suite
doctor- Check React Native environment health (includes Android and iOS checks)verify:setup- Quick verification that all environments are functional (exits 1 on failure)
test:metro- Test Metro bundler functionalitytest:metro:shutdown- Test Metro shutdown behavior
The React Native plugin runs its own initialization hook plus the Android and iOS hooks:
init-hook.sh- React Native-specific initialization- Android
init-hook.shandsetup.sh - iOS
init-hook.shandsetup.sh
Additional exports:
NODE_BINARY- Set to Node.js binary path
{
"include": ["github:segment-integrations/devbox-plugins?dir=plugins/react-native"],
"packages": [
"nodejs@20",
"watchman@latest",
"jdk17@latest",
"gradle@latest"
],
"env": {
"ANDROID_APP_ID": "com.reactnativeexample",
"ANDROID_APP_APK": "android/app/build/outputs/apk/debug/app-debug.apk",
"ANDROID_MAX_API": "35",
"ANDROID_SDK_REQUIRED": "0"
},
"shell": {
"scripts": {
"install": [
"npm install"
],
"build:android": [
"devbox run install",
"cd android && ./gradlew assembleDebug"
],
"build:ios": [
"devbox run install",
"cd ios && pod install --repo-update",
"ios.sh xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -configuration Debug -destination 'generic/platform=iOS Simulator' build"
],
"start:android": [
"process-compose -f tests/dev-android.yaml"
],
"start:ios": [
"process-compose -f tests/dev-ios.yaml"
]
}
}
}Limit which devices are evaluated (useful for CI to reduce build time):
{
"env": {
"ANDROID_DEVICES": "min,max",
"IOS_DEVICES": "min,max"
}
}Run Android emulator without GUI in CI environments:
{
"env": {
"EMU_HEADLESS": "1",
"ANDROID_DISABLE_SNAPSHOTS": "1"
}
}React Native projects can skip unused platform setup:
{
"shell": {
"scripts": {
"build:ios": [
"ANDROID_SKIP_SETUP=1 devbox run --pure build:ios"
],
"build:android": [
"IOS_SKIP_SETUP=1 devbox run --pure build:android"
]
}
}
}Or set in process-compose test suites:
processes:
build-ios:
environment:
- ANDROID_SKIP_SETUP=1
command: devbox run build:iosPin to specific Xcode version:
{
"env": {
"IOS_DEVELOPER_DIR": "/Applications/Xcode-15.4.app/Contents/Developer"
}
}Override Android SDK settings:
{
"env": {
"ANDROID_COMPILE_SDK": "35",
"ANDROID_TARGET_SDK": "34",
"ANDROID_BUILD_TOOLS_VERSION": "35.0.0",
"ANDROID_INCLUDE_NDK": "true",
"ANDROID_NDK_VERSION": "27.0.12077973"
}
}Use existing local Android SDK instead of Nix-managed SDK:
{
"env": {
"ANDROID_LOCAL_SDK": "1"
}
}Requires ANDROID_HOME or ANDROID_SDK_ROOT to be set in your system environment.
Configure test output directories:
{
"env": {
"REPORTS_DIR": "test-reports",
"TEST_LOGS_DIR": "test-reports/logs",
"TEST_RESULTS_DIR": "test-reports/results"
}
}Customize Metro bundler port range:
{
"env": {
"RN_METRO_PORT_START": "9000",
"RN_METRO_PORT_END": "9099"
}
}Device definitions in devbox.d/android/devices/*.json:
Note: The actual directory name under
devbox.d/depends on how the plugin is included. When using GitHub includes (e.g.,github:segment-integrations/devbox-plugins?dir=plugins/android), the directory name is derived from the repository path (e.g.,devbox.d/segment-integrations.devbox-plugins.android/devices/). When using local path includes, it matches the plugin directory name.
{
"name": "pixel_api30",
"api": 30,
"device": "pixel",
"tag": "google_apis",
"preferred_abi": "x86_64"
}name- Device identifier (string, required)api- Android API level (number, required)device- AVD device profile ID (string, required)tag- System image tag (string, optional)- Valid values:
google_apis,google_apis_playstore,play_store,aosp_atd,google_atd
- Valid values:
preferred_abi- Preferred ABI (string, optional)- Valid values:
arm64-v8a,x86_64,x86
- Valid values:
Device definitions in devbox.d/ios/devices/*.json:
Note: The actual directory name under
devbox.d/depends on how the plugin is included, same as the Android plugin above. For example, with GitHub includes it becomesdevbox.d/segment-integrations.devbox-plugins.ios/devices/.
{
"name": "iPhone 15 Pro",
"runtime": "17.5"
}name- Simulator display name (string, required)runtime- iOS version (string, required)
Convention for min/max device definitions:
min.json- Minimum supported platform versionmax.json- Maximum/latest supported platform version
Example Android min.json:
{
"name": "min",
"api": 21,
"device": "pixel",
"tag": "google_apis"
}Example iOS max.json:
{
"name": "max",
"runtime": "18.0"
}Generated at devbox.d/android/devices/devices.lock by android.sh devices eval.
Note: The actual path depends on how the plugin is included. See the note in the Device Definitions section above.
Format (plain text):
device_name:checksum
min:abc123def456
max:789ghi012jkl
Generated at devbox.d/ios/devices/devices.lock by ios.sh devices eval.
Note: The actual path depends on how the plugin is included. See the note in the Device Definitions section above.
Format (JSON):
{
"devices": [
{
"name": "iPhone 15 Pro",
"runtime": "17.5"
},
{
"name": "iPad Pro",
"runtime": "17.5"
}
],
"checksum": "abc123..."
}Lock files should be committed to version control to optimize CI builds by limiting which SDK versions are evaluated.
The .devbox/virtenv/ directory is temporary and auto-regenerated. After modifying plugin configurations or when the virtenv is stale:
devbox shell # Regenerates virtenvOr force sync without entering shell:
devbox run sync # If sync script is defined- Android Reference - Complete Android API reference
- iOS Reference - Complete iOS API reference
- React Native Reference - Complete React Native API reference
- Plugin Conventions - Plugin development patterns
- CLAUDE.md - Repository overview and development rules