build-run-debug

Build, run, and debug macOS apps with shell-first Xcode and SwiftPM workflows.

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/AarnavBaddam/skills --skill build-run-debug-aarnavbaddam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-run-debug
Source: https://github.com/AarnavBaddam/skills/tree/main/build-run-debug
Command: npx skills add https://github.com/AarnavBaddam/skills --skill build-run-debug-aarnavbaddam

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? macOS developers often juggle ad hoc xcodebuild and swift build commands, manual process kills, and fragile launch steps when iterating on apps. This Skill standardizes the entire loop into one project-local script that kills the old process, builds the target, and launches the fresh binary, with optional debugging and log streaming modes. ## Core Features & Use Cases - Single Run Entrypoint: Creates script/build_and_run.sh as the canonical kill + build + run command for Xcode workspaces, Xcode projects, and SwiftPM packages. - SwiftPM GUI App Bundling: Stages a project-local .app bundle with a generated Info.plist so AppKit/SwiftUI SwiftPM apps launch with proper Dock activation instead of raw executable quirks. - Debug and Telemetry Modes: Adds --debug (lldb), --logs and --telemetry (unified log streaming), and --verify (process existence check) flags to the same script. - Codex Run Button Integration: Writes .codex/environments/environment.toml so the Codex app exposes a Run action wired to the script. - Use Case: You have a SwiftPM SwiftUI app that shows no Dock icon when launched directly. This Skill generates the bundle-staging script, launches it with open -n, and streams unified logs to diagnose activation issues. ## Quick Start Ask the agent to discover the project, create a build_and_run.sh script, and launch the macOS app while reporting any build or runtime blocker.

Frequently Asked Questions about build-run-debug

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build and run a macOS app from the command line?

Use xcodebuild for Xcode workspaces or projects and swift build for SwiftPM packages, then launch the built artifact. This Skill wraps that flow in one script/build_and_run.sh entrypoint that kills the old process, builds, and relaunches.

How to run a SwiftPM SwiftUI app with a Dock icon?

Stage a project-local .app bundle: copy the built binary into Contents/MacOS, generate an Info.plist with CFBundlePackageType=APPL and NSPrincipalClass=NSApplication, then launch with /usr/bin/open -n. Direct executable launch causes no Dock icon and missing bundle identifier warnings.

Can I debug a macOS app with lldb from a script?

Yes. The generated build_and_run.sh supports a --debug flag that launches the built binary under lldb. For GUI apps it points lldb at the staged bundle binary; for CLI tools it debugs the raw executable directly.

Why does my SwiftUI app window not come to the foreground?

If the .app bundle launches but the window stays hidden, the entrypoint likely needs NSApp.setActivationPolicy(.regular) and NSApp.activate(ignoringOtherApps: true). Verify launch behavior first with the script's --verify or --logs modes.

Does this workflow support iOS simulators or mobile targets?

No. The workflow is macOS-only and explicitly avoids simulator, touch, and mobile-specific tooling. It targets Xcode macOS schemes and SwiftPM executables or AppKit/SwiftUI desktop apps.

How do I stream logs for a running macOS app process?

Use the script's --logs flag to stream unified logs filtered by process name, or --telemetry to filter by subsystem identifier. Both modes launch the app first, then run /usr/bin/log stream with the appropriate predicate.