Files
beat-hound/docs/native-builds.md
T

71 lines
2.9 KiB
Markdown

# Native Mobile Builds
BeatHound uses Capacitor to wrap the web app for Android and iOS. The `android/` and `ios/` folders contain the native projects.
## Android and e/OS
The Android project has a minimum SDK level of 24. It can run on Android 7.0 and newer. Compatible e/OS 4 or newer devices can install the same APK when their Android base meets that minimum.
### Build a debug APK
Install Node.js, JDK 21, and Android SDK Platform 36 with Build Tools 36.0.0. Accept the Android SDK licenses, then run:
```sh
npm install
npm run android:debug
```
Gradle creates the debug APK here:
```text
android/app/build/outputs/apk/debug/app-debug.apk
```
The checked-in file `downloads/BeatHound-Android-eOS-1.0.0-debug.apk` is debug-signed and linked from the root README. It is for direct testing and sideloading, not for Google Play publication. A release build should use a private signing key that is not stored in Git.
`npm run android:debug` also copies each new debug build to that `downloads/` path.
### Install with ADB
With USB debugging enabled on an Android or e/OS device, install the APK with:
```sh
adb install downloads/BeatHound-Android-eOS-1.0.0-debug.apk
```
You can also transfer the APK to the device and open it. The device may ask you to allow installation from that file source.
## iOS
Capacitor's Xcode project is in `ios/App/App.xcodeproj`. Building an iOS app requires macOS and Xcode. This repository includes a script for creating an unsigned IPA that can be signed on-device for personal sideloading; this Linux build environment cannot produce the IPA itself.
### Build an unsigned IPA for sideloading
On a Mac with Node.js and Xcode installed:
```sh
npm install
npm run ios:unsigned-ipa
```
The script builds the app for physical iOS devices and writes:
```text
downloads/ios/BeatHound-iOS-1.0.0-unsigned.ipa
```
The IPA is not directly installable by opening it on an iPhone. Import it into a sideloading app such as AltStore or Sideloadly and sign it with your Apple ID. A free personal Apple ID can be used for personal sideloading, but the signature needs periodic renewal and the sideloading app's setup instructions must be followed. No App Store upload is involved.
For managed distribution to other users or direct installation without a sideloading app, use Apple's supported distribution and signing options in Xcode. Keep certificates, provisioning profiles, and signing keys out of Git.
## Mobile build commands
| Command | Result |
| --- | --- |
| `npm run build:mobile` | Builds the web assets with relative paths for Capacitor. |
| `npm run cap:sync` | Builds web assets and syncs both native projects. |
| `npm run android:debug` | Builds and syncs Android, then creates a debug APK. |
| `npm run ios:sync` | Builds and syncs the iOS project. |
| `npm run ios:open` | Opens the iOS project in Xcode; run this on macOS. |
| `npm run ios:unsigned-ipa` | Builds an unsigned iOS IPA for personal sideloading; run this on macOS with Xcode. |