Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Document Android CLI setup

Manav Rathi73115860a497
diff --git a/mobile/apps/photos/docs/README.md b/mobile/apps/photos/docs/README.md
index b387c9e80c..47f83af2ec 100644
--- a/mobile/apps/photos/docs/README.md
+++ b/mobile/apps/photos/docs/README.md
@@ -2,6 +2,10 @@
Documentation and notes about more advanced or infrequently needed details.
+### Android CLI
+
+See [android-cli.md](android-cli.md) for working on the Android app without installing Android Studio.
+
### VS Code
The [vscode](vscode) folder contains template launch configuration. Copy into a top-level `.vscode` to use them.
diff --git a/mobile/apps/photos/docs/android-cli.md b/mobile/apps/photos/docs/android-cli.md
new file mode 100644
index 0000000000..d8ee0fa0bb
--- /dev/null
+++ b/mobile/apps/photos/docs/android-cli.md
@@ -0,0 +1,28 @@
+# Android dev without Android Studio
+
+You don't need to install the full Android Studio for working on the Android app, you can instead just install a JDK and the Android command line tools and thereafter drive everything from the terminal.
+
+```sh
+# Install JDK
+brew install openjdk@17
+sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk
+
+# Add the following to your .zshrc/.bashrc
+export ANDROID_HOME=$(brew --prefix)/share/android-commandlinetools
+export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH"
+
+# Install Android command-line tools
+brew install --cask android-commandlinetools
+flutter doctor --android-licenses # OR sdkmanager --licenses
+sdkmanager "platform-tools" "platforms;android-36" "build-tools;36.0.0"
+
+# Create emulator (on Intel Mac, use x86_64 instead of arm64-v8a)
+sdkmanager "emulator" "system-images;android-36;google_apis;arm64-v8a"
+avdmanager create avd -n pixel9-36 -k "system-images;android-36;google_apis;arm64-v8a" -d pixel_9
+emulator -avd pixel9-36
+
+# Profit
+flutter run --flavor independent -d sdk
+```
+
+The above is macOS-specific, but swap `brew` for your package manager (unless `brew` is your package manager) and skip the JDK symlink step and it should work on Linux too.
diff --git a/mobile/native/android/apps/ensu/README.md b/mobile/native/android/apps/ensu/README.md
index 6b7d65dc7c..18461adb31 100644
--- a/mobile/native/android/apps/ensu/README.md
+++ b/mobile/native/android/apps/ensu/README.md
@@ -32,6 +32,8 @@ A custom endpoint can be baked into the build via `./gradlew :app-ui:installDebu
> [!NOTE]
>
> If you'd rather not open Android Studio, this section is for you.
+>
+> To skip the Android Studio install entirely, see [photos/docs/android-cli.md](../../../../apps/photos/docs/android-cli.md).
Build and install a debug APK on a connected device or emulator: