# Make Your App Updatest-Ready

A guide for developers on how to ensure your app's updates are detectable by Updatest.

## How Updatest Detects Updates

Updatest scans your app's bundle to find update sources. It checks for:

- [Homebrew Cask](/content/integration/#homebrew/index.html)
- [Sparkle](/content/integration/#sparkle/index.html)
- [Mac App Store](/content/integration/#mac-app-store/index.html)
- [Electron](/content/integration/#electron/index.html)
- [GitHub Releases](/content/integration/#github-releases/index.html)

## Homebrew Cask

The most reliable way to distribute Mac apps

[Homebrew](https://brew.sh/) is a package manager for macOS that makes it easy for users to install and update software. When your app is available as a Homebrew Cask, Updatest can automatically detect updates and help users install them.

Homebrew Casks are community-maintained, but you can submit and maintain your own app's cask to ensure accuracy.

### Setup Guide

#### Create a Cask formula

Your cask formula defines how Homebrew installs your app. Here's a basic example:

```ruby
cask "your-app" do
  version "1.2.3"
  sha256 "abc123..."

url "https://example.com/releases/YourApp-#{version}.dmg"
  name "Your App"
  desc "A description of your app"
  homepage "https://yourapp.com"

app "Your App.app"

zap trash: [ \
      "~/Library/Application Support/Your App",\
      "~/Library/Preferences/com.yourcompany.yourapp.plist",\
  ]
end
```

#### Submit to Homebrew

Submit your cask to the [homebrew-cask](https://github.com/Homebrew/homebrew-cask) repository. Fork the repo, add your cask file to the Casks directory, and open a pull request.

For detailed instructions, see the [Cask Cookbook](https://docs.brew.sh/Cask-Cookbook).

#### Keep it updated

When you release a new version, update your cask formula with the new version number, SHA256 hash, and download URL. You can automate this with [Homebrew's update process](https://github.com/Homebrew/homebrew-cask/blob/master/CONTRIBUTING.md#updating-a-cask).

Many developers use CI/CD to automatically submit cask updates when they publish new releases.

#### Tips

- Include accurate bundle identifiers in your cask for better Updatest matching
- Use versioned download URLs (e.g., /releases/v1.2.3/App.dmg) for reliability
- Consider hosting on GitHub Releases for consistent download availability

#### Resources

- [Cask Cookbook→](https://docs.brew.sh/Cask-Cookbook)
- [homebrew-cask Repository→](https://github.com/Homebrew/homebrew-cask)
- [How to Submit a PR→](https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request)

## Sparkle

The standard for Mac app auto-updates

[Sparkle](https://sparkle-project.org/) is the de facto standard for Mac app updates. It provides a native update experience with delta updates, automatic background checks, and user-friendly UI.

Updatest supports apps that use Sparkle for updates. For best compatibility, follow Sparkle's standard configuration practices.

#### Do NOT generate your appcast at runtime

Some developers try to dynamically generate appcast responses from their server. This breaks update detection for tools like Updatest.

Always host a static appcast.xml file at your SUFeedURL that returns valid XML without requiring special parameters or app context.

#### Avoid authentication if possible

Updatest may be able to access authenticated appcast URLs, but results can vary. For the most reliable update detection, host your appcast at a publicly accessible URL.

### Setup Guide

#### Add Sparkle to your app

Install Sparkle via Swift Package Manager, CocoaPods, or manual integration:

```swift
// Swift Package Manager
dependencies: [\
    .package(url: "https://github.com/sparkle-project/Sparkle", from: "2.0.0")\
]
```

#### Configure your Info.plist

Add the required Sparkle keys to your Info.plist:

```xml
<key>SUFeedURL</key>
<string>https://yourapp.com/appcast.xml</string>

<key>SUPublicEDKey</key>
<string>your-ed25519-public-key</string>
```

#### Create your appcast feed

Generate an appcast.xml file that lists your app versions. Use Sparkle's generate_appcast tool:

```bash
./bin/generate_appcast /path/to/your/releases
```

#### Host your appcast publicly

Host your appcast.xml at a stable, publicly accessible URL. This is the URL you put in SUFeedURL.

Example appcast structure:

```xml
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle">
<channel>
    <title>Your App Changelog</title>
    <item>
      <title>Version 1.2.3</title>
      <sparkle:version>1.2.3</sparkle:version>
      <sparkle:shortVersionString>1.2.3</sparkle:shortVersionString>
      <pubDate>Mon, 20 Jan 2025 12:00:00 +0000</pubDate>
      <enclosure url="https://yourapp.com/releases/YourApp-1.2.3.zip"
                 sparkle:edSignature="..."
                 length="12345678"
                 type="application/octet-stream"/>
    </item>
</channel>
</rss>
```

#### Tips

- Use HTTPS for your appcast URL
- Include sparkle:shortVersionString for human-readable version numbers
- Sign your updates with EdDSA (Ed25519) for security
- Test your appcast URL in a browser to ensure it's accessible

#### Resources

- [Sparkle Project→](https://sparkle-project.org/)
- [Sparkle Documentation→](https://sparkle-project.org/documentation/)
- [Publishing an Update→](https://sparkle-project.org/documentation/publishing/)

## Mac App Store

Apple's official distribution channel

Apps distributed through the Mac App Store are automatically detected by Updatest. When Apple approves an update, Updatest will show it to users.

There's no additional configuration needed for Updatest compatibility. If your app is on the Mac App Store, it works automatically.

### Setup Guide

#### Publish to the Mac App Store

Follow Apple's standard submission process through [App Store Connect](https://appstoreconnect.apple.com/). Once your app is approved and published, Updatest will detect it.

#### Submit updates through App Store Connect

When you release updates, submit them through App Store Connect as usual. After Apple approves the update, Updatest will show it to users who have your app installed.

#### Tips

- Updates are detected as soon as Apple publishes them
- Users can update directly through Updatest or the Mac App Store app
- No additional metadata or configuration is required

#### Resources

- [App Store Submission Guidelines→](https://developer.apple.com/app-store/submitting/)
- [App Store Connect→](https://appstoreconnect.apple.com/)

## Electron

For cross-platform desktop apps

Updatest supports Electron apps that use [electron-builder](https://www.electron.build/) for packaging and auto-updates.

Configure electron-builder's publish settings to enable update detection.

#### Use a repository name that matches your app

Updatest filters out generic or template repositories to avoid false positives. If you forked from an Electron starter template, make sure to update the publish configuration to use your own repository with a name that relates to your app.

### Setup Guide

#### Configure electron-builder

In your electron-builder config (package.json or electron-builder.yml), set the publish target:

```json
{
  "build": {
    "appId": "com.yourcompany.yourapp",
    "publish": {
      "provider": "github",
      "owner": "yourcompany",
      "repo": "yourapp"
    }
  }
}
```

#### Alternative: Generic server

For self-hosted update servers, use the generic provider:

```json
{
  "build": {
    "publish": {
      "provider": "generic",
      "url": "https://updates.yourapp.com"
    }
  }
}
```

#### Host latest-mac.yml for generic servers

For generic servers, host a latest-mac.yml file at your update URL with version info:

```yaml
version: 1.2.3
files:
  - url: YourApp-1.2.3-arm64.dmg
    sha512: abc123...
  - url: YourApp-1.2.3-x64.dmg
    sha512: def456...
path: YourApp-1.2.3.dmg
sha512: abc123...
releaseDate: '2025-01-20T12:00:00.000Z'
```

#### Tips

- Use electron-builder's built-in publish command for consistent releases
- Supported providers: github, generic, s3, spaces (DigitalOcean)
- For architecture-specific builds, include arm64/x64 in filenames

#### Resources

- [electron-builder→](https://www.electron.build/)
- [Publish Configuration→](https://www.electron.build/configuration/publish)
- [Auto Update Documentation→](https://www.electron.build/auto-update)

## GitHub Releases

Perfect for open-source and developer tools

Updatest supports apps that distribute updates through GitHub Releases. This works great for open-source apps and developer tools.

To enable GitHub release detection, include your repository URL in your app and publish releases with proper version tags.

#### Use a repository name that matches your app

Updatest filters out generic or template repositories to avoid false positives. Make sure your GitHub repository name or owner relates to your app's name.

### Setup Guide

#### Include your GitHub repository URL

Add your GitHub repository URL to your app's Info.plist:

```xml
<key>GHRepositoryURL</key>
<string>https://github.com/yourname/yourapp</string>
```

#### Publish releases on GitHub

Create releases on GitHub with semantic version tags:

```bash
# Tag and push your release
git tag v1.2.3
git push origin v1.2.3

# Then create the release on GitHub with this tag
```

#### Attach macOS binaries

Attach your macOS app (.dmg or .zip) as a release asset. Updatest will display the download URL to users so they can grab the update.

#### Tips

- Version tags can use 'v' prefix (v1.2.3) or not (1.2.3) - both work
- Release notes from the GitHub Release body are displayed to users
- Your repository must be public for Updatest to access it

#### Resources

- [GitHub Releases Documentation→](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository)
- [Auto-generated Release Notes→](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes)

## Need Help?

If your app uses a different update mechanism or you're having trouble getting Updatest to detect your updates, let us know.
