zed-industries/zed · error

cannot start app bundle {}

Error message

cannot start app bundle {}

What it means

When opening Zed via LaunchServices (LSOpenFromURLSpec), a non-zero OSStatus means macOS refused to launch the app bundle identified by the CLI's version string. This is an OS-level launch failure, not a Zed crash: the bundle is unreadable, quarantined, damaged, or the LaunchServices database is inconsistent.

Source

Thrown at crates/cli/src/main.rs:1381

                            kCFStringEncodingUTF8,
                            ptr::null(),
                        ));
                        // equivalent to: open zed-cli:... -a /Applications/Zed\ Preview.app
                        let urls_to_open =
                            CFArray::from_copyable(&[url_to_open.as_concrete_TypeRef()]);
                        LSOpenFromURLSpec(
                            &LSLaunchURLSpec {
                                appURL: app_url.as_concrete_TypeRef(),
                                itemURLs: urls_to_open.as_concrete_TypeRef(),
                                passThruParams: ptr::null(),
                                launchFlags: kLSLaunchDefaults | kLSLaunchDontSwitch,
                                asyncRefCon: ptr::null_mut(),
                            },
                            ptr::null_mut(),
                        )
                    };

                    anyhow::ensure!(
                        status == 0,
                        "cannot start app bundle {}",
                        self.zed_version_string()
                    );
                }

                Self::LocalPath { executable, .. } => {
                    let executable_parent = executable
                        .parent()
                        .with_context(|| format!("Executable {executable:?} path has no parent"))?;
                    let subprocess_stdout_file = fs::File::create(
                        executable_parent.join("zed_dev.log"),
                    )
                    .with_context(|| format!("Log file creation in {executable_parent:?}"))?;
                    let subprocess_stdin_file =
                        subprocess_stdout_file.try_clone().with_context(|| {
                            format!("Cloning descriptor for file {subprocess_stdout_file:?}")
                        })?;

View on GitHub (pinned to bc538def45)

Solutions

  1. Remove the quarantine attribute: `xattr -dr com.apple.quarantine /Applications/Zed.app`
  2. Re-download and reinstall Zed from zed.dev in case the bundle is damaged
  3. Test with `open -a /Applications/Zed.app` to see the raw LaunchServices error, and rebuild the LS database if needed: `/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user`
  4. Check free disk space; a full disk makes bundle registration fail
Defensive patterns

Strategy: try-catch

Validate before calling

# preflight: bundle exists, is readable, and is not quarantined
[ -d /Applications/Zed.app ] || { echo 'Zed.app missing'; exit 2; }
xattr -p com.apple.quarantine /Applications/Zed.app 2>/dev/null && echo 'quarantined: clear with xattr -dr'

Try / catch

match app.launch() {
    Ok(()) => {}
    Err(err) if err.to_string().contains("cannot start app bundle") => {
        // treat as environment problem: clear quarantine, reinstall, then retry once
        eprintln!("launch failed; run: xattr -dr com.apple.quarantine /Applications/Zed.app");
    }
    Err(err) => return Err(err),
}

Prevention

When it happens

Trigger: LSOpenFromURLSpec returns non-zero for the resolved Zed.app URL: Gatekeeper quarantine on a downloaded app, a corrupted or incomplete bundle, a full disk preventing LS registration, or a stale LaunchServices database.

Common situations: First launch after downloading via browser/airdrop; app copied between machines; macOS update re-evaluating notarization; corporate MDM blocking unsigned or quarantined apps.

Related errors


AI-assisted analysis of zed-industries/zed@bc538def45 (2026-08-16). Data as JSON: /api/errors/b49fd54ed3788439. Report an issue: GitHub.