Android Development
Here is how to set up the Android development environment. You can use vscode to develop this.
What to download
Install with homebrew:
# Java 17 (required by the Android build system)
brew install --cask temurin@17
# Android Studio (brings the Android SDK, emulator, and device manager)
brew install --cask android-studio
After installing, launch Android Studio. The setup wizard will install the SDK etc.
Set up your shell
To make Android tools work from terminal, add these lines to ~/.zshrc
export ANDROID_HOME="$HOME/Library/Android/sdk"
export PATH="$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$ANDROID_HOME/cmdline-tools/latest/bin"
Create an emulator
emulator -avd Pixel_8 &
Build and run
cd android
# Build and install the debug app on the emulator
./gradlew installDebug
adb shell am start -n org.hackleyclubz.app/.MainActivity
# Watch the app's logs
adb logcat --pid=$(adb shell pidof -s org.hackleyclubz.app)
Guidelines
-
Test your changes! Run the app in the emulator.
./gradlew testDebugUnitTest lint -
Work on the dev granch. Commit to dev and I’ll merge it.
