Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

scripts/dev-install.sh: one signed Coucou in /Applications, so macOS keeps its permissions

Claude07e085ca4f77
diff --git a/CLAUDE.md b/CLAUDE.md
index c666caac..654283ba 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -15,6 +15,7 @@ Coucou is a native macOS app (`NotchBuddy/`); `windows/` is the Tauri version fo
```
cd NotchBuddy && xcodegen && xcodebuild -scheme NotchBuddy -configuration Debug build
```
+To run it day to day on the Mac (signed, iPhone link, permissions kept across builds): `./scripts/dev-install.sh` — it installs the only Coucou in /Applications and removes the copies earlier builds left.
Windows and Linux: `cd windows && npm install && npm run tauri dev`
## Rules
diff --git a/scripts/dev-install.sh b/scripts/dev-install.sh
new file mode 100755
index 00000000..f925b40e
--- /dev/null
+++ b/scripts/dev-install.sh
@@ -0,0 +1,60 @@
+#!/usr/bin/env bash
+# Builds Coucou the way it runs every day (DebugCloud: signed with the Apple Development
+# certificate, iPhone link on) and makes it the only Coucou: installed in /Applications,
+# the copies left by earlier builds removed.
+#
+# Why: macOS gives its permissions (Accessibility, Screen Recording, microphone…) to one
+# app signed one way. An unsigned Debug build looks like a new app after every build, and
+# each copy of Coucou.app is one more entry to allow. One signed app at one place keeps
+# its permissions from one build to the next.
+#
+# ./scripts/dev-install.sh
+#
+# Use it instead of xcodebuild by hand or ▶ in Xcode (which leave copies in DerivedData).
+set -euo pipefail
+
+REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
+BUNDLE_ID="fr.louisraille.NotchBuddy"
+DERIVED="$HOME/Library/Developer/Xcode/DerivedData/CoucouDev"
+BUILT="$DERIVED/Build/Products/DebugCloud/Coucou.app"
+LSREGISTER="/System/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks/LaunchServices.framework/Versions/Current/Support/lsregister"
+
+# The App Store Coucou (fr.louisraille.Coucou) has the same file name: never overwrite it.
+TARGET="/Applications/Coucou.app"
+if [ -d "$TARGET" ]; then
+ EXISTING=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "$TARGET/Contents/Info.plist" 2>/dev/null || echo "")
+ if [ "$EXISTING" != "$BUNDLE_ID" ]; then
+ mkdir -p "$HOME/Applications"
+ TARGET="$HOME/Applications/Coucou.app"
+ echo "/Applications/Coucou.app is another Coucou ($EXISTING): installing in ~/Applications instead."
+ fi
+fi
+
+echo "Building (DebugCloud)…"
+cd "$REPO_ROOT/NotchBuddy"
+xcodegen >/dev/null
+xcodebuild -scheme NotchBuddyCloud -configuration DebugCloud -allowProvisioningUpdates \
+ -derivedDataPath "$DERIVED" -quiet build
+
+echo "Quitting Coucou…"
+osascript -e "tell application id \"$BUNDLE_ID\" to quit" >/dev/null 2>&1 || true
+for _ in 1 2 3 4 5; do pgrep -x Coucou >/dev/null || break; sleep 1; done
+pkill -x Coucou 2>/dev/null || true
+
+echo "Installing in $TARGET…"
+rm -rf "$TARGET"
+ditto "$BUILT" "$TARGET"
+
+# The build stays in DerivedData for the next (incremental) build, but macOS must not
+# count it as another Coucou. Copies from Xcode's own builds (▶, xcodebuild by hand) go.
+"$LSREGISTER" -u "$BUILT" >/dev/null 2>&1 || true
+for old in "$HOME"/Library/Developer/Xcode/DerivedData/NotchBuddy-*/Build/Products/*/Coucou.app; do
+ [ -d "$old" ] || continue
+ "$LSREGISTER" -u "$old" >/dev/null 2>&1 || true
+ rm -rf "$old"
+ echo "Removed an old build: $old"
+done
+"$LSREGISTER" -f "$TARGET" >/dev/null 2>&1 || true
+
+open "$TARGET"
+echo "Coucou is running from $TARGET."