Back to Ente

Ensu Apple Platforms

mobile/native/darwin/Apps/ensu/README.md

2.0.343.5 KB
Original Source

Ensu Apple Platforms

Build (Terminal)

All commands below assume you run them from darwin/Apps/ensu.

Quick scripts

bash
./build.sh                 # Debug build for iOS simulator (prefers booted iPhone)
./build.sh device          # Debug build for connected iOS device
./build.sh archive         # Release archive (.xcarchive)
./build.sh ipa             # Release IPA export (uses ExportOptions-AppStore.plist)
./run.sh                   # Build + install + launch on iOS simulator (prefers booted iPhone)

Helpful flags:

  • --destination-id <id> to force a specific simulator/device
  • --endpoint <url> to set ENTE_API_ENDPOINT
  • --archive-path, --export-path, --export-options-plist for release flows
  • --skip-build for run.sh

Run ./build.sh --help or ./run.sh --help for full options.

Generated bindings & dependencies

  • SwiftMath is fetched via SwiftPM (https://github.com/mgriebling/SwiftMath.git).
  • UniFFI Swift bindings are generated locally and gitignored:
    • ensu/Generated/core*, ensu/Generated/db*, ensu/Generated/sync*
    • ../Packages/Rust/Sources/InferenceRS/
    • ../Packages/Rust/InferenceRSFFI.xcframework

The Xcode build script (scripts/build-rust.sh) builds Rust static libs, but it does regenerate the core, db, and sync Swift bindings into ensu/Generated/ as part of the build. ../Packages/Rust/tool/generate_bindings.sh and ../Packages/Rust/tool/build_xcframework.sh handle the InferenceRS bindings and xcframework.

Debug Build (Simulator)

bash
cd darwin/Apps/ensu
xcodebuild \
  -project ensu.xcodeproj \
  -scheme ensu \
  -configuration Debug \
  -sdk iphonesimulator \
  -destination 'platform=iOS Simulator,name=iPhone 15' \
  -derivedDataPath build

Debug Build (Device)

bash
cd darwin/Apps/ensu
xcodebuild \
  -project ensu.xcodeproj \
  -scheme ensu \
  -configuration Debug \
  -sdk iphoneos \
  -destination 'generic/platform=iOS' \
  -derivedDataPath build

Release Build (Archive)

bash
cd darwin/Apps/ensu
xcodebuild \
  -project ensu.xcodeproj \
  -scheme ensu \
  -configuration Release \
  -sdk iphoneos \
  -destination 'generic/platform=iOS' \
  -archivePath build/Archive/ensu.xcarchive \
  archive

Release IPA (App Store)

bash
cd darwin/Apps/ensu
xcodebuild \
  -exportArchive \
  -archivePath build/Archive/ensu.xcarchive \
  -exportPath build/Export \
  -exportOptionsPlist ExportOptions-AppStore.plist

Installation (Terminal)

Debug (Simulator)

bash
cd darwin/Apps/ensu
xcrun simctl boot "iPhone 15" || true
xcrun simctl install booted build/Build/Products/Debug-iphonesimulator/ensu.app
xcrun simctl launch booted io.ente.ensu

Debug (Physical Device)

bash
cd darwin/Apps/ensu
xcrun devicectl device list
xcrun devicectl device install app \
  --device <DEVICE_UDID> \
  build/Build/Products/Debug-iphoneos/ensu.app

Release (IPA)

Install the exported IPA via Apple Configurator or TestFlight after xcodebuild -exportArchive.

Note: App Store IPA export requires valid distribution signing certificate/profile on this machine.

Custom API Endpoint

Set the endpoint at build time using ENTE_API_ENDPOINT. If it is not set, the app defaults to https://api.ente.io.

bash
cd darwin/Apps/ensu
ENTE_API_ENDPOINT="https://your-endpoint.example" \
  xcodebuild \
  -project ensu.xcodeproj \
  -scheme ensu \
  -configuration Debug \
  -sdk iphonesimulator \
  -destination 'platform=iOS Simulator,name=iPhone 15' \
  -derivedDataPath build