Prerequisites
Before building the Android app, ensure you have:Node.js
Version 14 or higher (v20 recommended)
Android Studio
Latest stable version with Android SDK
Java JDK
JDK 17 or higher
Android SDK
API Level 22+ (Android 5.1+)
Installation Steps
Clone and install dependencies
If you haven’t already, clone the repository and install dependencies:
Add Android platform (first time only)
Add the Android platform to your project:This creates the
android/ directory with a native Android project.Build the web app
Build the optimized web assets:This compiles TypeScript and creates production bundles in
dist/.You can combine steps 3 and 4 with the convenience command:This runs
tsc && vite build && cap sync android in one command.Capacitor Configuration
The app is configured incapacitor.config.ts:
capacitor.config.ts
- appId:
com.embytok.app- Unique Android package identifier - appName:
EmbyTok- Display name on device - webDir:
dist- Built web assets directory - androidScheme:
https- Uses HTTPS scheme for web content - CapacitorHttp: Enabled for native HTTP requests
Building APK with Android Studio
Open project in Android Studio
Launch Android Studio and open the Android project:Or manually open the
android/ directory in Android Studio.Configure build variant
In Android Studio:
- Select Build > Select Build Variant
- Choose release for production builds or debug for testing
Generate APK
Build the APK:
- Select Build > Build Bundle(s) / APK(s) > Build APK(s)
- Wait for the build to complete
- Click locate in the notification to find the APK
Building from Command Line
You can also build APK without Android Studio:Debug APK
android/app/build/outputs/apk/debug/app-debug.apk
Release APK (unsigned)
android/app/build/outputs/apk/release/app-release-unsigned.apk
Sign APK Manually
Sign the release APK usingapksigner:
Installing on Device
Via USB (Development)
Enable developer options
On your Android device:
- Go to Settings > About phone
- Tap Build number 7 times
- Enable Developer options
- Enable USB debugging
Via APK File
- Transfer the APK to your device
- Open the APK file on your device
- Allow installation from unknown sources if prompted
- Tap Install
Live Reload Development
For faster development, use live reload:Remember to remove the
server.url configuration before building production APK.Customization
App Name and Icon
Modify Android app metadata:- App name: Edit
android/app/src/main/res/values/strings.xml - Package name: Change
appIdincapacitor.config.ts, then sync - App icon: Replace icons in
android/app/src/main/res/mipmap-*/
Permissions
EmbyTok requires these permissions (automatically added by Capacitor):android/app/src/main/AndroidManifest.xml
Supported Android Versions
- Minimum SDK: API 22 (Android 5.1 Lollipop)
- Target SDK: API 34 (Android 14)
- Compile SDK: API 34
android/app/build.gradle if needed.
Troubleshooting
Build fails with 'capacitor' not found
Build fails with 'capacitor' not found
Solution: Ensure Capacitor is installed:
Gradle build fails
Gradle build fails
Common fixes:
- Update Gradle wrapper:
- Clean build:
- Invalidate caches in Android Studio: File > Invalidate Caches / Restart
App shows blank screen
App shows blank screen
Solution: Verify web assets were synced:Check that
android/app/src/main/assets/public/ contains your built files.adb devices shows no devices
adb devices shows no devices
Solution:
- Enable USB debugging on device
- Try different USB cable
- Restart adb server:
Network requests fail in app
Network requests fail in app
Solution: Check network security configuration. For HTTP (non-HTTPS) servers, add to
android/app/src/main/res/xml/network_security_config.xml:Publishing to Google Play
To publish EmbyTok to Google Play Store:- Create signed release APK or AAB (Android App Bundle recommended)
- Create Google Play Developer account ($25 one-time fee)
- Create app listing with screenshots and descriptions
- Upload APK/AAB for internal testing, then production
- Submit for review
Next Steps
iOS App
Build native iOS app with UIKit
Configuration
Configure Emby/Plex servers
Capacitor Plugins
Add native device features
Mobile Guide
Using EmbyTok on mobile devices