{"record":{"id":"b49fd54ed3788439","repo":"zed-industries/zed","slug":"cannot-start-app-bundle","errorCode":null,"errorMessage":"cannot start app bundle {}","messagePattern":"cannot start app bundle (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/main.rs","lineNumber":1381,"sourceCode":"                            kCFStringEncodingUTF8,\n                            ptr::null(),\n                        ));\n                        // equivalent to: open zed-cli:... -a /Applications/Zed\\ Preview.app\n                        let urls_to_open =\n                            CFArray::from_copyable(&[url_to_open.as_concrete_TypeRef()]);\n                        LSOpenFromURLSpec(\n                            &LSLaunchURLSpec {\n                                appURL: app_url.as_concrete_TypeRef(),\n                                itemURLs: urls_to_open.as_concrete_TypeRef(),\n                                passThruParams: ptr::null(),\n                                launchFlags: kLSLaunchDefaults | kLSLaunchDontSwitch,\n                                asyncRefCon: ptr::null_mut(),\n                            },\n                            ptr::null_mut(),\n                        )\n                    };\n\n                    anyhow::ensure!(\n                        status == 0,\n                        \"cannot start app bundle {}\",\n                        self.zed_version_string()\n                    );\n                }\n\n                Self::LocalPath { executable, .. } => {\n                    let executable_parent = executable\n                        .parent()\n                        .with_context(|| format!(\"Executable {executable:?} path has no parent\"))?;\n                    let subprocess_stdout_file = fs::File::create(\n                        executable_parent.join(\"zed_dev.log\"),\n                    )\n                    .with_context(|| format!(\"Log file creation in {executable_parent:?}\"))?;\n                    let subprocess_stdin_file =\n                        subprocess_stdout_file.try_clone().with_context(|| {\n                            format!(\"Cloning descriptor for file {subprocess_stdout_file:?}\")\n                        })?;","sourceCodeStart":1363,"sourceCodeEnd":1399,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/cli/src/main.rs#L1363-L1399","documentation":"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.","triggerScenarios":"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.","commonSituations":"First launch after downloading via browser/airdrop; app copied between machines; macOS update re-evaluating notarization; corporate MDM blocking unsigned or quarantined apps.","solutions":["Remove the quarantine attribute: `xattr -dr com.apple.quarantine /Applications/Zed.app`","Re-download and reinstall Zed from zed.dev in case the bundle is damaged","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`","Check free disk space; a full disk makes bundle registration fail"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# preflight: bundle exists, is readable, and is not quarantined\n[ -d /Applications/Zed.app ] || { echo 'Zed.app missing'; exit 2; }\nxattr -p com.apple.quarantine /Applications/Zed.app 2>/dev/null && echo 'quarantined: clear with xattr -dr'","typeGuard":null,"tryCatchPattern":"match app.launch() {\n    Ok(()) => {}\n    Err(err) if err.to_string().contains(\"cannot start app bundle\") => {\n        // treat as environment problem: clear quarantine, reinstall, then retry once\n        eprintln!(\"launch failed; run: xattr -dr com.apple.quarantine /Applications/Zed.app\");\n    }\n    Err(err) => return Err(err),\n}","preventionTips":["Clear quarantine attributes right after installing","Keep free disk space so LaunchServices can register bundles","Prefer `open -a Zed.app` in scripts to get clearer LS diagnostics"],"tags":["macos","launch-services","cli","quarantine"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}