# __APP_DISPLAY_NAME__ for Safari

The macOS container app that ships the Safari Web Extension build of
__APP_DISPLAY_NAME__. Generated by `buddy extension:safari:init`; safe to
regenerate with `--force` (your signing settings are the only thing to redo).

- `__APP_NAME__/` — the SwiftUI container app (shows extension state, opens
  Safari's extension settings).
- `__APP_NAME__ Extension/` — the Safari Web Extension target. Its
  `Resources/` folder is a mirror of the safari build output, produced by
  `buddy extension:safari:app` (or `syncSafariResources`).
- `__APP_NAME__.xcodeproj` — checked in on purpose: building the app never
  requires re-running Apple's `safari-web-extension-converter`.

## Prerequisites

- macOS with Safari 18.4+ (the manifest pins
  `browser_specific_settings.safari.strict_min_version`).
- Full Xcode (Command Line Tools alone are not enough):

  ```bash
  sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
  xcodebuild -license accept   # first launch only
  ```

## Build

```bash
buddy extension:safari:app
```

This builds the extension (safari target), syncs the bundle into the appex
Resources, and runs xcodebuild. Then launch __APP_NAME__.app once (it
registers the extension with Safari) and enable it under
Safari > Settings > Extensions, granting it website access.

## Signing

The project uses `safariTeamId` when configured and otherwise leaves
`DEVELOPMENT_TEAM` empty so anyone can build.

Local, unsigned (no Apple account): the default build uses
`CODE_SIGNING_ALLOWED=NO`. Unsigned extensions require
Safari > Develop > Allow Unsigned Extensions (resets on Safari updates).

Signed (Apple Developer Program): select your team under Signing &
Capabilities for both targets, then:

```bash
buddy extension:safari:app --signed            # Debug, Apple Development identity
buddy extension:safari:app --signed --release  # Release
```

## Distribution

- Mac App Store: `xcodebuild archive` (or Xcode > Product > Archive), then
  Xcode Organizer > Distribute App > App Store Connect.
- Developer ID + notarization: archive, export with a Developer ID profile,
  then `xcrun notarytool submit ... --wait && xcrun stapler staple
  __APP_NAME__.app`. The project already enables the hardened runtime.

Either way, bump `MARKETING_VERSION` in the project when the extension
releases.
