This guide outlines the build and distribution process for SharpGlass, featuring Smart Onboarding.
SharpGlass uses a Smart Onboarding approach to minimize the initial download size while ensuring a robust execution environment.
- Tiny App Bundle: The main application bundle contains the Swift executable, assets, and the source code for the
ml-sharpbackend. It does not contain the heavy Python virtual environment or pre-downloaded models. - On-Demand Installation: On the first run, the user is guided through an interactive setup screen. The app automatically:
- Creates a Python virtual environment in
~/Library/Application Support/com.trond.SharpGlass/venv. - Installs dependencies from the bundled
ml-sharpsource. - Verifies the installation.
- Creates a Python virtual environment in
- macOS 15.0+ (Sequoia)
- Python 3.13: The user must have Python 3.13 installed and available in their path (e.g., via Homebrew
brew install python@3.13or python.org). The app will check for this.
Ensure ml-sharp source is updated in Sources/Main/Resources/ml-sharp.
(This is handled automatically by the project structure, but ensure no junk files like .git or venv are present in the source folder before release builds to save space).
Run the included build script to compile the release binary, generate assets, and create the .app bundle structure automatically:
./build_distribution.shThe output will be located at dist/SharpGlass.app.
To sign with your Apple Developer ID (required for Notarization):
export SIGNING_IDENTITY="Developer ID Application: Your Name (TEAMID)"
./build_distribution.shIf you prefer to build manually:
- Compile Assets: Use
actoolto compileAssets.xcassets. - Build Binary:
swift build -c release - Assemble Bundle: Create the
SharpGlass.appdirectory structure and copy the binary,Info.plist,Assets.car, andml-sharpsource code intoContents/Resources.
Note: The SwiftPM build automatically bundles ml-sharp and Assets.xcassets into the bundle structure if run via Xcode or properly configured bundle tool.
For public distribution, sign the app with your Developer ID:
codesign --force --options runtime --sign "Developer ID Application: Your Name (TEAMID)" SharpGlass.appThen submit for notarization using xcrun notarytool.