2026-01-01 15:38:27 +01:00
---
2026-01-04 14:32:47 +00:00
summary: "Setup guide for developers working on the Clawdbot macOS app"
2026-01-01 15:38:27 +01:00
read_when:
- Setting up the macOS development environment
---
# macOS Developer Setup
2026-01-04 14:32:47 +00:00
This guide covers the necessary steps to build and run the Clawdbot macOS application from source.
2026-01-01 15:38:27 +01:00
## Prerequisites
Before building the app, ensure you have the following installed:
2026-01-01 17:38:16 +01:00
1. **Xcode 26.2+** : Required for Swift development.
2026-01-11 10:15:37 +00:00
2. **Node.js 22+ & pnpm** : Required for the gateway, CLI, and packaging scripts.
2026-01-01 15:38:27 +01:00
## 1. Initialize Submodules
2026-01-04 14:32:47 +00:00
Clawdbot depends on several submodules (like `Peekaboo` ). You must initialize these recursively:
2026-01-01 15:38:27 +01:00
```bash
git submodule update --init --recursive
```
## 2. Install Dependencies
Install the project-wide dependencies:
```bash
pnpm install
```
## 3. Build and Package the App
2026-01-04 14:32:47 +00:00
To build the macOS app and package it into `dist/Clawdbot.app` , run:
2026-01-01 15:38:27 +01:00
```bash
./scripts/package-mac-app.sh
```
If you don't have an Apple Developer ID certificate, the script will automatically use **ad-hoc signing** (`-` ).
> **Note**: Ad-hoc signed apps may trigger security prompts. If the app crashes immediately with "Abort trap 6", see the [Troubleshooting](#troubleshooting) section.
2026-01-11 10:15:37 +00:00
## 4. Install the CLI
2026-01-01 15:38:27 +01:00
2026-01-11 10:15:37 +00:00
The macOS app expects a global `clawdbot` CLI install to manage background tasks.
2026-01-01 15:38:27 +01:00
2026-01-11 10:15:37 +00:00
**To install it (recommended):**
2026-01-04 14:32:47 +00:00
1. Open the Clawdbot app.
2026-01-01 15:38:27 +01:00
2. Go to the **General** settings tab.
2026-01-11 10:15:37 +00:00
3. Click ** "Install CLI"**.
2026-01-01 15:38:27 +01:00
2026-01-11 10:15:37 +00:00
Alternatively, install it manually:
2026-01-01 15:38:27 +01:00
```bash
2026-01-11 10:15:37 +00:00
npm install -g clawdbot@< version >
2026-01-01 15:38:27 +01:00
```
## Troubleshooting
2026-01-06 22:18:08 +01:00
### Build Fails: Toolchain or SDK Mismatch
The macOS app build expects the latest macOS SDK and Swift 6.2 toolchain.
**System dependencies (required):**
- **Latest macOS version available in Software Update** (required by Xcode 26.2 SDKs)
- **Xcode 26.2** (Swift 6.2 toolchain)
**Checks:**
```bash
xcodebuild -version
xcrun swift --version
```
If versions don’ t match, update macOS/Xcode and re-run the build.
2026-01-01 15:38:27 +01:00
### App Crashes on Permission Grant
If the app crashes when you try to allow **Speech Recognition** or **Microphone** access, it may be due to a corrupted TCC cache or signature mismatch.
**Fix:**
1. Reset the TCC permissions:
```bash
2026-01-04 14:32:47 +00:00
tccutil reset All com.clawdbot.mac.debug
2026-01-01 15:38:27 +01:00
```
2026-01-06 20:25:08 +00:00
2. If that fails, change the `BUNDLE_ID` temporarily in [`scripts/package-mac-app.sh` ](https://github.com/clawdbot/clawdbot/blob/main/scripts/package-mac-app.sh ) to force a "clean slate" from macOS.
2026-01-01 15:38:27 +01:00
### Gateway "Starting..." indefinitely
If the gateway status stays on "Starting...", check if a zombie process is holding the port:
```bash
2026-01-08 08:24:16 +01:00
clawdbot daemon status
clawdbot daemon stop
# If you’ re not using a LaunchAgent (dev mode / manual runs), find the listener:
lsof -nP -iTCP:18789 -sTCP:LISTEN
2026-01-01 15:38:27 +01:00
```
2026-01-08 10:42:23 +01:00
If a manual run is holding the port, stop that process (Ctrl+C). As a last resort, kill the PID you found above.