بنقرة واحدة
kmp-build-commands
Gradle build commands: assembleDebug, assembleRelease, APK output paths, and emulator installation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Gradle build commands: assembleDebug, assembleRelease, APK output paths, and emulator installation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Template repo file structure: where screens, navigation, theme, data, and platform entries live in the monorepo
Android TV build and D-pad QA using Android CLI first, with bounded Gradle and ADB fallbacks
Expo Application Services cloud build configuration for TV app APK and IPA generation
Expo TV configuration: app.json plugins, prebuild settings, platform-specific config for react-native-tvos
Fire TV leanback manifest configuration: banner icons, LEANBACK_LAUNCHER intent filter, TV-specific Android settings
Fire TV Vega OS (Kepler) build system: npx kepler build, Vega app structure, platform-specific components
| name | kmp-build-commands |
| description | Gradle build commands: assembleDebug, assembleRelease, APK output paths, and emulator installation |
| applies_to | ["scaffold","screens","branding","content"] |
| load_when | building the app, installing on emulator, or locating build artifacts |
The kmptv project uses Gradle with the Android Gradle Plugin. All builds run from the project root. The Android TV app produces an APK; the Apple TV app builds via Xcode.
./gradlew :androidtv-app:assembleDebug
Output: androidtv-app/build/outputs/apk/debug/androidtv-app-debug.apk
./gradlew :androidtv-app:assembleRelease
Output: androidtv-app/build/outputs/apk/release/androidtv-app-release-unsigned.apk
./gradlew :androidtv-app:assemble
android initadb in PATH for D-pad input and Logcat only# Android CLI describes targets and expected output artifacts.
android describe --project_dir=.
# Gradle owns compilation.
./gradlew :androidtv-app:assembleDebug
# Android CLI owns deployment and launch.
android run \
--apks=androidtv-app/build/outputs/apk/debug/androidtv-app-debug.apk \
--device=<serial> \
--activity=.MainActivity
./gradlew :shared-core:compileKotlinAndroid
./gradlew :shared-core:compileKotlinIosArm64
./gradlew :shared-core:compileKotlinIosSimulatorArm64
./gradlew :shared-core:compileKotlinIosX64
./gradlew :shared-core:allTests
./gradlew :shared-core:linkDebugFrameworkIosSimulatorArm64
Output: shared-core/build/bin/iosSimulatorArm64/debugFramework/shared_core.framework
./gradlew compileKotlin
./gradlew clean :androidtv-app:assembleDebug
# Show dependency tree for androidtv-app
./gradlew :androidtv-app:dependencies --configuration releaseRuntimeClasspath
# Check for dependency updates (if plugin installed)
./gradlew dependencyUpdates
The Apple TV app is built via Xcode, not Gradle:
# Open in Xcode
open appletv-app/kmptv/kmptv.xcodeproj
# Build from command line
xcodebuild -project appletv-app/kmptv/kmptv.xcodeproj \
-scheme kmptv \
-destination 'platform=tvOS Simulator,name=Apple TV 4K (3rd generation)' \
build
| Artifact | Path |
|---|---|
| Debug APK | androidtv-app/build/outputs/apk/debug/androidtv-app-debug.apk |
| Release APK | androidtv-app/build/outputs/apk/release/androidtv-app-release-unsigned.apk |
| Lint report | androidtv-app/build/reports/lint-results-debug.html |
| Test results (shared-core) | shared-core/build/reports/tests/ |
| iOS framework | shared-core/build/bin/iosSimulatorArm64/debugFramework/ |
The project uses Gradle 8.9 via the wrapper. Always use ./gradlew (not a system-installed gradle):
# Check Gradle version
./gradlew --version
# Update wrapper (if needed)
./gradlew wrapper --gradle-version 8.9
SDK location not foundFix: Create local.properties in project root:
sdk.dir=/Users/<username>/Library/Android/sdk
Or set ANDROID_HOME environment variable.
compileOptions / jvmToolchain mismatchThe project requires JDK 17:
kotlin { jvmToolchain(17) }
Fix: Ensure JAVA_HOME points to JDK 17:
export JAVA_HOME=$(/usr/libexec/java_home -v 17)
Build cache is corrupted./gradlew clean
rm -rf ~/.gradle/caches/transforms-*
./gradlew :androidtv-app:assembleDebug
Add to gradle.properties:
org.gradle.jvmargs=-Xmx4g -XX:+HeapDumpOnOutOfMemoryError
android emulator list
android emulator start <avd-name>
adb devices
# Android CLI owns layout and screenshot evidence.
android layout --pretty --output=layout.json
android screen capture --output=screenshot.png
# Android CLI has no remote-key command, so ADB sends D-pad events.
adb shell input keyevent KEYCODE_DPAD_UP
adb shell input keyevent KEYCODE_DPAD_DOWN
adb shell input keyevent KEYCODE_DPAD_LEFT
adb shell input keyevent KEYCODE_DPAD_RIGHT
adb shell input keyevent KEYCODE_DPAD_CENTER # Select
adb shell input keyevent KEYCODE_BACK
# Android CLI has no Logcat command, so ADB captures logs.
adb logcat -s "kmptv" --format=brief
./gradlew assembleDebug from a subdirectory. Always run from project root where gradlew lives.gradle instead of ./gradlew. System Gradle may be a different version and break the build.installDebug and manually copying the APK. installDebug handles uninstall-reinstall and is faster.adb devices before install. If no device is connected, installDebug fails silently or with a confusing error.