#!/usr/bin/env bash # Build an unsigned LNReader .ipa for sideloading. SideStore (or AltStore) signs it # on install with a free Apple ID; see docs/ios-sidestore.md. # # Runs on macOS with Xcode (and its command line tools), Node >= 22.11, pnpm and # CocoaPods. Output: build/LNReader-unsigned.ipa set -euo pipefail cd "$(dirname "$0")/.." [[ "$(uname)" == "Darwin" ]] || { echo "build-ios-unsigned: needs macOS with Xcode" >&2; exit 1; } command -v xcodebuild >/dev/null || { echo "build-ios-unsigned: install Xcode first" >&2; exit 1; } command -v pod >/dev/null || { echo "build-ios-unsigned: install CocoaPods (brew install cocoapods)" >&2; exit 1; } pnpm install --frozen-lockfile # postinstall embeds the reader assets for iOS pnpm run generate:env:release pnpm exec expo prebuild --platform ios --clean # also runs pod install xcodebuild \ -workspace ios/LNReader.xcworkspace \ -scheme LNReader \ -configuration Release \ -sdk iphoneos \ -destination 'generic/platform=iOS' \ -derivedDataPath build/ios \ CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" \ build app=build/ios/Build/Products/Release-iphoneos/LNReader.app [[ -d "$app" ]] || { echo "build-ios-unsigned: $app was not produced" >&2; exit 1; } rm -rf build/ipa build/LNReader-unsigned.ipa mkdir -p build/ipa/Payload cp -R "$app" build/ipa/Payload/ (cd build/ipa && zip -qry ../LNReader-unsigned.ipa Payload) rm -rf build/ipa echo "Built build/LNReader-unsigned.ipa ($(du -h build/LNReader-unsigned.ipa | cut -f1))"