TODO
Arch Linux / Linux General Setup - Kotlin Multiplatform Compatible
You don't need Android Studio! Download Command Line Tools directly from Google:
-
Download link:
π Android SDK Command-Line Tools -
Extract and move to
/opt
(optional):sudo mkdir -p /opt/android-sdk/cmdline-tools/latest sudo unzip commandlinetools-linux-*.zip -d /opt/android-sdk/cmdline-tools/latest
-
Set environment variables (add these to your
.bashrc
/.zshrc
):export ANDROID_SDK_ROOT=/opt/android-sdk export PATH=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$PATH export PATH=$ANDROID_SDK_ROOT/platform-tools:$PATH export PATH=$ANDROID_SDK_ROOT/build-tools/33.0.2:$PATH `
Make sure you have sdkmanager
(inside cmdline-tools/latest/bin
).
sdkmanager --update
sdkmanager "platform-tools" \
"build-tools;33.0.2" \
"platforms;android-33" \
"system-images;android-33;google_apis;x86_64"
sdkmanager --licenses
Use JetBrains Kotlin Wizard to generate the project (if you want a template): π Kotlin Multiplatform Wizard
curl -s https://get.sdkman.io | bash
sdk install kotlin
Extract or move the generated project to your working folder.
Or start a minimal Kotlin project manually and add Android targets in Gradle.
-
Enable Developer Options β Wireless Debugging on your Android phone.
-
Pair device:
adb pair <ip:port> <pairing-code>
Example:
adb pair 192.168.0.107:38303 408434
-
Connect:
adb connect 192.168.0.107:43847
adb devices
Run Gradle tasks to build and install the app:
./gradlew tasks # View available tasks
./gradlew assembleDebug
./gradlew installDebug
Wireless-connected devices will receive the app directly.
./gradlew installDebug --continuous
It will automatically install new builds when files change.
If you get license errors like:
You have not accepted the license agreements of the following SDK components
sdkmanager --licenses
cp -r $ANDROID_SDK_ROOT/licenses ./licenses
Put it in the project root where Gradle can find it.
- β Android SDK without Android Studio (mirror or archive recommended!)
- β AUR Package: android-sdk-cmdline-tools-latest
- β ADB over WSL2
- β Pair Android Device over Wireless ADB
-
Emulators (Optional)
sdkmanager "emulator" avdmanager create avd -n test -k "system-images;android-33;google_apis;x86_64" emulator -avd test
# Download & extract command-line tools
sudo mkdir -p /opt/android-sdk/cmdline-tools/latest
sudo unzip commandlinetools-linux-*.zip -d /opt/android-sdk/cmdline-tools/latest
# Set environment variables
export ANDROID_SDK_ROOT=/opt/android-sdk
export PATH=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$PATH
export PATH=$ANDROID_SDK_ROOT/platform-tools:$PATH
# Install SDK components
sdkmanager --update
sdkmanager "platform-tools" "build-tools;33.0.2" "platforms;android-33"
sdkmanager --licenses
# Wireless debugging
adb pair <ip:port> <pairing-code>
adb connect <ip:port>
# Build & install app
./gradlew installDebug --continuous
βββ Architecture
β βββ Lifecycle (Manages activity/fragment lifecycle)
β βββ LiveData (Observable data holder)
β βββ ViewModel (Holds UI-related data)
β βββ Room (SQLite object mapping)
β βββ WorkManager (Background work)
β
βββ UI
β βββ Jetpack Compose (Declarative UI)
β β βββ UI Toolkit (Layout, Material components)
β β βββ Animation (Motion and transitions)
β β βββ Tooling (Preview, Debugging)
β βββ AppCompat (Backward compatibility)
β βββ Fragment (UI modularity)
β
βββ Behavior
β βββ Notifications (Alerts and messaging)
β βββ Permissions (Runtime permissions)
β βββ Sharing (Content sharing between apps)
β
βββ Foundation
βββ Android KTX (Kotlin extensions for Android APIs)
βββ App Startup (Initialize components quickly)
βββ Test (JUnit extensions, Espresso, etc.)