FyroxEngine/Fyrox · error

ADB error

Error message

ADB error: {err:?}

What it means

Logged error in fyrox-build-tools' Android export when spawning or running the ADB command fails. run_build composes an adb shell command to launch rust.<package>/android.app.NativeActivity on the device; if Command::spawn returns Err, this message is logged. It indicates ADB tooling or device connection problems, not a game bug.

Solutions

  1. Verify adb is installed and on PATH (adb version)
  2. Check a device is connected and authorized (adb devices shows 'device' state)
  3. Ensure the ADB path in export options points to the platform-tools binary
  4. Run `adb kill-server && adb start-server` to reset the ADB daemon, then retry
Defensive patterns

Strategy: validation

Validate before calling

let adb = which::which("adb")?;
let out = Command::new(&adb).args(["devices"]).output()?;
assert!(out.status.success() && String::from_utf8_lossy(&out.stdout).contains("device\t"));

Try / catch

match Command::new("adb").args([...]).spawn() {
    Ok(child) => { /* wait, check exit status */ },
    Err(e) if e.kind() == io::ErrorKind::NotFound => eprintln!("adb not found — install platform-tools"),
    Err(e) => eprintln!("ADB error: {e}"),
}

Prevention

When it happens

Trigger: adb binary not on PATH, adb executable path misconfigured in ExportOptions, spawn fails (adb missing/not executable), or device not connected when launching the NativeActivity.

Common situations: Android SDK platform-tools not installed, PATH missing platform-tools, no USB debugging authorization on the device, multiple devices without -s, device disconnected mid-deploy.

Related errors


AI-assisted analysis of FyroxEngine/Fyrox@76c91aad8e (2026-09-10). Data as JSON: /api/errors/9e657ceb3f3541ea. Report an issue: GitHub.

Appendix: source

Thrown at fyrox-build-tools/src/export/android.rs:123

        .arg(format!("{package_name}.apk"))
        .spawn()
    {
        match adb.wait_with_output() {
            Ok(_) => {
                let compatible_package_name = package_name.replace('-', "_");
                Log::verify(
                    utils::make_command("adb")
                        .arg("shell")
                        .arg("am")
                        .arg("start")
                        .arg("-n")
                        .arg(format!(
                            "rust.{compatible_package_name}/android.app.NativeActivity"
                        ))
                        .spawn(),
                );
            }
            Err(err) => Log::err(format!("ADB error: {err:?}")),
        }
    }
}

pub fn copy_assets(
    export_options: &ExportOptions,
    package: &Package,
    package_dir_path: &Utf8Path,
    temp_folders: &mut Vec<PathBuf>,
    resource_manager: &ResourceManager,
    convert: bool,
) -> Result<(), String> {
    // Asset management on Android is quite annoying, because all other target platforms
    // uses the workspace manifest path as a root directory and all paths in code/assets
    // stored relatively to it. On Android, however, all your assets must be in unified
    // assets storage. This means that, if we simply specify assets folder to be `../data`
    // (relative to `executor-android`), it will put all the assets in the storage, but
    // their path will become relative to the storage. For example, in your code you can

View on GitHub (pinned to 76c91aad8e)