Add Capacitor mobile builds and Android APK

This commit is contained in:
Ninosaurier committed 2026-11-15 15:15:36 +01:00
1 parent 4f221ea122
commit 8ef90b5898
86 files changed
+2874 -7

No files matched your search

+2
View File
@@ -9,6 +9,7 @@ export default defineConfig({
{ text: 'Home', link: '/' },
{ text: 'User guide', link: '/software-guide' },
{ text: 'Software documentation', link: '/software-documentation' },
{ text: 'Native builds', link: '/native-builds' },
],
sidebar: [
{
@@ -17,6 +18,7 @@ export default defineConfig({
{ text: 'Overview', link: '/' },
{ text: 'User and development guide', link: '/software-guide' },
{ text: 'Software documentation', link: '/software-documentation' },
{ text: 'Native builds', link: '/native-builds' },
],
},
],
+61
View File
@@ -0,0 +1,61 @@
# 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`. An IPA must be built on macOS with Xcode and signed for distribution. This Linux build environment can prepare and sync the project, but it cannot produce or sign an IPA.
On a Mac:
1. Install Node.js and Xcode.
2. Run `npm install` in the repository.
3. Run `npm run ios:sync` to build the web assets and copy them into the iOS project.
4. Run `npm run ios:open` to open the project in Xcode.
5. Select an Apple development team and signing method in Xcode.
6. Archive the app and export the signed IPA from Xcode.
Do not commit Apple certificates, provisioning profiles, or signing keys to this repository. Add the exported IPA to `downloads/` only after it has been signed for the intended distribution method.
## 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. |
+8 -2
View File
@@ -15,6 +15,8 @@ Main tools:
- **React** builds the interface and manages state.
- **TypeScript** checks types before the app is built.
- **Ionic React** provides page and control components.
- **Capacitor** wraps the web app in native Android and iOS projects.
- **Capacitor** wraps the web app in native Android and iOS projects.
- **Ionicons** provides the control icons.
- **Vite** runs the local development server and builds the static site.
- **Vitest** runs the tests.
@@ -283,9 +285,13 @@ npm test
The scripts are defined in `package.json`. `npm run build` first runs TypeScript with no output, then Vite writes the app's static production site to `dist/`. The React plugin and Vitest environment are set in `vite.config.ts`. TypeScript strict options are in `tsconfig.json`; ESLint rules are in `eslint.config.js`.
`capacitor.config.ts` sets the native app ID and points Capacitor to `dist/`. The Android debug build is copied into `downloads/` by `npm run android:debug`. iOS project sync is available on all platforms, but creating a signed IPA requires macOS and Xcode.
`capacitor.config.ts` points Capacitor to the `dist/` web build and defines the native app ID. `npm run build:mobile` uses relative asset paths so the native WebView can load local files.
The documentation site uses VitePress. Run `npm run docs:dev` to work on it locally, `npm run docs:build` to create its static files in `docs/.vitepress/dist/`, and `npm run docs:preview` to view that build. The pages are Markdown files under `docs/`; navigation and local search are set in `docs/.vitepress/config.mts`.
The project includes a web manifest and home-screen icons in `public/`, but it does not include a service worker, offline caching, persistence, a native mobile wrapper, or a server deployment configuration.
The project includes a web manifest and home-screen icons in `public/`, plus Capacitor wrappers in `android/` and `ios/`. It does not include a service worker, offline caching, persistence, or a server deployment configuration. Native build steps are in [Native Mobile Builds](native-builds.md).
## 10. Main implementation limits
@@ -295,4 +301,4 @@ The project includes a web manifest and home-screen icons in `public/`, but it d
- Playback timing uses a browser interval and may drift under load.
- Points are rounded to one of four playback subdivisions per main step when they play.
- The app makes audio with browser-generated oscillators and noise. It does not load user audio files.
- The repository builds a static web app; native app packaging is not configured here.
- iOS IPA creation requires macOS, Xcode, and signing configured outside this Linux build environment.
+8 -2
View File
@@ -66,7 +66,7 @@ Browsers often block sound until the user interacts with the page. Press **Play*
The app makes playback ticks with a browser timer. At each tick it checks whether a sound point should play. The exact timing can depend on the browser and the device.
The page layout adapts to different screen sizes. The project also includes a web app manifest, icons, and mobile home-screen metadata. This project does not include code for saving patterns, working offline, or building a native mobile app.
The page layout adapts to different screen sizes. The project includes a web app manifest, icons, and Capacitor projects for Android and iOS. It does not include code for saving patterns or working offline. See the [native build guide](native-builds.md) for mobile build requirements.
## 4. Run the project on your computer
@@ -100,7 +100,7 @@ npm test
## 5. How the software is organized
BeatHound is a React and TypeScript app. Ionic React provides many of the buttons, popovers, and page elements. Vite runs the development server and builds the app.
BeatHound is a React and TypeScript app. Ionic React provides many of the buttons, popovers, and page elements. Vite runs the development server and builds the web app. Capacitor wraps that web app in Android and iOS projects.
The main path through the app is:
@@ -153,6 +153,9 @@ The main path through the app is:
| `src/audio/AudioEngine.ts` | Starts the browser audio context and sends sounds to it. |
| `src/audio/instruments.ts` | Creates the synthesized instrument sounds. |
| `src/audio/soundVoices.ts` | Connects each instrument ID to its sound-making function. |
| `capacitor.config.ts` | Sets the app ID, app name, and native web asset folder. |
| `android/` and `ios/` | Capacitor project files for native mobile builds. |
| `downloads/` | Holds the Android/e/OS debug APK available from this repository. |
| `src/sequencer.test.ts` | Tests timing, loop geometry, state changes, colors, and templates. |
| `public/` | Holds icons, logos, and the web app manifest. |
@@ -164,12 +167,15 @@ The main path through the app is:
| --- | --- |
| `package.json` | Lists the packages used by the project and the npm commands. |
| `package-lock.json` | Records exact package versions for repeatable installs. |
| `capacitor.config.ts` | Sets the native app ID, display name, and web build folder. |
| `vite.config.ts` | Turns on the React plugin and sets up Vitest. |
| `tsconfig.json` | Sets TypeScript rules. The project uses strict type checking. |
| `eslint.config.js` | Sets the code checks used by ESLint. |
| `.gitignore` | Keeps generated files such as `dist/` and `node_modules/` out of Git. |
| `public/manifest.webmanifest` | Gives the app a name, icons, colors, and home-screen display settings. |
| `src/ionicons.d.ts` | Tells TypeScript which Ionicons names this app uses. |
| `android/` and `ios/` | Capacitor native project files. |
| `downloads/` | Checked-in Android/e/OS debug APK. |
## 6. How loop data works