{"record":{"id":"5b8b4e35d977345f","repo":"golang/go","slug":"xcrun-simctl-install-booted-q-v","errorCode":null,"errorMessage":"xcrun simctl install booted %q: %v","messagePattern":"xcrun simctl install booted %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"misc/ios/go_ios_exec.go","lineNumber":140,"sourceCode":"\t}\n\tif err := os.WriteFile(filepath.Join(appdir, \"Info.plist\"), []byte(infoPlist(pkgpath)), 0744); err != nil {\n\t\treturn err\n\t}\n\tif err := os.WriteFile(filepath.Join(appdir, \"ResourceRules.plist\"), []byte(resourceRules), 0744); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc installSimulator(appdir string) error {\n\tcmd := exec.Command(\n\t\t\"xcrun\", \"simctl\", \"install\",\n\t\t\"booted\", // Install to the booted simulator.\n\t\tappdir,\n\t)\n\tif out, err := cmd.CombinedOutput(); err != nil {\n\t\tos.Stderr.Write(out)\n\t\treturn fmt.Errorf(\"xcrun simctl install booted %q: %v\", appdir, err)\n\t}\n\treturn nil\n}\n\nfunc runSimulator(appdir, bundleID string, args []string) error {\n\txcrunArgs := []string{\"simctl\", \"spawn\",\n\t\t\"booted\",\n\t\tappdir + \"/gotest\",\n\t}\n\txcrunArgs = append(xcrunArgs, args...)\n\tcmd := exec.Command(\"xcrun\", xcrunArgs...)\n\tcmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr\n\terr := cmd.Run()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"xcrun simctl launch booted %q: %v\", bundleID, err)\n\t}\n\n\treturn nil","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/misc/ios/go_ios_exec.go#L122-L158","documentation":"Returned by installSimulator (go_ios_exec.go:140) when `xcrun simctl install booted <appdir>` fails. go_ios_exec installs the compiled test app bundle into the booted iOS Simulator before spawning it; CombinedOutput is captured and written to stderr, then this error wraps the xcrun failure.","triggerScenarios":"No simulator is booted (so 'booted' resolves to nothing), the app bundle is malformed, the simulator is busy/unresponsive, disk full on the simulator, or xcrun/Command Line Tools are misconfigured.","commonSituations":"Developer forgot to boot a Simulator (`xcrun simctl boot <udid>`); CoreSimulator service stuck; Xcode/CLT license not accepted; appdir points to a stale/incomplete .app; multiple simulators booted confusing 'booted'.","solutions":["Boot a simulator first: `xcrun simctl boot 'iPhone 15'` then `open -a Simulator`.","Accept the Xcode license: `sudo xcodebuild -license accept`.","Verify only one simulator is booted: `xcrun simctl list devices booted`.","Re-read stderr captured by xcrun (it is written before the error) for the precise reason."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"func simulatorBooted() error {\n    out, err := exec.Command(\"xcrun\", \"simctl\", \"list\", \"devices\", \"booted\").Output()\n    if err != nil {\n        return fmt.Errorf(\"simctl list: %w\", err)\n    }\n    if !strings.Contains(string(out), \"(\") { // no booted entries\n        return errors.New(\"no booted simulator\")\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Boot a simulator (`xcrun simctl boot`) before running go_ios_exec.","Accept the Xcode license (`sudo xcodebuild -license accept`).","Keep exactly one simulator booted to avoid 'booted' ambiguity."],"tags":["ios","simulator","xcrun","go-test","exec-wrapper"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}