{"record":{"id":"ff28292c6592d8c9","repo":"jdx/mise","slug":"mas-install-requires-a-numeric-adam-id-p-us","errorCode":null,"errorMessage":"mas install requires a numeric ADAM ID ('{p}'); use `mas search` to find it","messagePattern":"mas install requires a numeric ADAM ID \\('(.+?)'\\); use `mas search` to find it","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/mas.rs","lineNumber":260,"sourceCode":"    async fn unavailable_reason_async(&self) -> Option<String> {\n        self.bin().await.err().map(|err| format!(\"{err:#}\"))\n    }\n\n    fn supports_version_pins(&self) -> bool {\n        false\n    }\n\n    async fn installed(&self, pkgs: &[PackageRequest]) -> Result<Vec<PackageStatus>> {\n        let apps = mas_list(self.bin().await?).await?;\n        Ok(statuses_from_apps(&apps, pkgs))\n    }\n\n    async fn install(&self, pkgs: &[PackageRequest], opts: &InstallOpts) -> Result<()> {\n        if let Some(p) = pkgs.iter().find(|p| p.version.is_some()) {\n            bail!(\"mas cannot install a pinned version ('{p}')\");\n        }\n        if let Some(p) = pkgs.iter().find(|p| !is_adam_id(&p.name)) {\n            bail!(\"mas install requires a numeric ADAM ID ('{p}'); use `mas search` to find it\");\n        }\n        let mut args = vec![\"install\".to_string()];\n        args.extend(pkgs.iter().map(|p| p.name.clone()));\n        if opts.dry_run {\n            miseprintln!(\"mas {}\", args.join(\" \"));\n            return Ok(());\n        }\n        debug!(\"$ mas {}\", args.join(\" \"));\n        let output = tokio::process::Command::new(self.bin().await?)\n            .args(&args)\n            .stdin(Stdio::null())\n            .output()\n            .await?;\n        if !output.status.success() {\n            let stderr = String::from_utf8_lossy(&output.stderr);\n            bail!(\"mas install failed: {}\", stderr.trim());\n        }\n        Ok(())","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/mas.rs#L242-L278","documentation":"mas identifies apps by numeric ADAM IDs (Apple's internal app identifiers). install() validates every requested package name with is_adam_id and rejects non-numeric names, telling the user to find the ID with `mas search`. This prevents passing app names like \"Xcode\" where mas expects \"497799835\".","triggerScenarios":"Calling install() with a PackageRequest whose name is not a numeric ADAM ID (e.g. a human-readable app name or slug); the first offending request is named in the message.","commonSituations":"Writing mise config with `mas = [\"xcode\"]` instead of the numeric ID; copying app names from the App Store URL instead of the numeric id in it.","solutions":["Run `mas search <app name>` to get the numeric ADAM ID and use it as the package name.","Find the numeric id in the App Store web URL (apps.apple.com/app/id<NUMBER>) and use that number.","Correct the package name in your config/lockfile to the digits-only ID and retry install."],"exampleFix":"// before\nmas = [\"xcode\"]\n// after\nmas = [\"497799835\"]","handlingStrategy":"validation","validationCode":"fn is_adam_id(name: &str) -> bool { !name.is_empty() && name.chars().all(|c| c.is_ascii_digit()) }\n// filter or resolve names to IDs before calling install","typeGuard":"fn is_adam_id(name: &str) -> bool { !name.is_empty() && name.chars().all(|c| c.is_ascii_digit()) }","tryCatchPattern":null,"preventionTips":["Always record numeric ADAM IDs, never app names, in mas config entries.","Resolve names with `mas search` once and store the ID.","Validate mas entries against a digits-only pattern in config linting."],"tags":["mas","adam-id","validation","install"],"backgroundTag":"invalid-identifier-format","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}