kmp-build-commands
Skill4 starsChanged 5 months agoMIT-0View on GitHub
Gradle build commands: assembleDebug, assembleRelease, APK output paths, and emulator installation
- Deletes or force-pushes
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 10ft-uiSkill
- amazon-devices-vega-app-performanceSkill
- amazon-devices-vega-best-practicesSkill
- amazon-devices-vega-setup-sdkSkill
- android-tv-testingSkill
- changelog-static-siteSkill
- creative-tv-uiSkill
- eas-buildSkill
- expo-tv-configSkill
- firetv-leanbackSkill
- kmp-compose-tvSkill
- kmp-data-layerSkill
- kmp-navigationSkill
- kmp-template-anatomySkill
- kmp-themingSkill
- kmp-verify-patternsSkill
- metaSkill
- rn-manifest-wiringSkill
- rn-shared-ui-catalogSkill
- rn-spatial-navigationSkill
- rn-template-anatomySkill
- rn-themingSkill
- vega-sdkSkill
- video-playerSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Use for emulator testing and development
- Very specific: line 163
Fix: Create local.properties in project root:
- Very specific: line 177
Fix: Ensure JAVA_HOME points to JDK 17:
- Very specific: line 238
Running
./gradlew assembleDebugfrom a subdirectory: Always run from project root where gradlew lives. - Very specific: line 242
Not checking
adb devicesbefore install: If no device is connected, installDebug fails silently or with a confusing error.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
KMP Build Commands
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.
Android TV builds
Debug APK (development)
./gradlew :androidtv-app:assembleDebugOutput: androidtv-app/build/outputs/apk/debug/androidtv-app-debug.apk
- Debuggable, not minified
- Fast build (~30-60s after first build)
- Use for emulator testing and development
Release APK (production)
./gradlew :androidtv-app:assembleReleaseOutput: androidtv-app/build/outputs/apk/release/androidtv-app-release-unsigned.apk
- Minified (if proguard is enabled, currently disabled in template)
- Not debuggable
- Requires signing for device installation
Build both variants
./gradlew :androidtv-app:assembleInstalling on emulator
Prerequisites
- Android TV emulator running (API 34, TV profile recommended)
- Android CLI installed and initialized with
android init adbin PATH for D-pad input and Logcat only
Build, install, and launch the debug APK
# 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=.MainActivityShared-core builds
Compile for Android target
./gradlew :shared-core:compileKotlinAndroidCompile for iOS targets (requires macOS)
./gradlew :shared-core:compileKotlinIosArm64
./gradlew :shared-core:compileKotlinIosSimulatorArm64
./gradlew :shared-core:compileKotlinIosX64Run all shared-core tests
./gradlew :shared-core:allTestsGenerate iOS framework (for Apple TV app)
./gradlew :shared-core:linkDebugFrameworkIosSimulatorArm64Output: shared-core/build/bin/iosSimulatorArm64/debugFramework/shared_core.framework
Full project builds
Compile everything
./gradlew compileKotlinClean build (when caches are stale)
./gradlew clean :androidtv-app:assembleDebugCheck dependencies
# Show dependency tree for androidtv-app
./gradlew :androidtv-app:dependencies --configuration releaseRuntimeClasspath
# Check for dependency updates (if plugin installed)
./gradlew dependencyUpdatesApple TV builds (Xcode)
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)' \
buildBuild output locations
| 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/ |
Gradle wrapper
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.9Common build issues
SDK location not found
Fix: Create local.properties in project root:
sdk.dir=/Users/<username>/Library/Android/sdkOr set ANDROID_HOME environment variable.
compileOptions / jvmToolchain mismatch
The 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:assembleDebugOut of memory during build
Add to gradle.properties:
org.gradle.jvmargs=-Xmx4g -XX:+HeapDumpOnOutOfMemoryErrorEmulator management
List available emulators
android emulator listStart TV emulator
android emulator start <avd-name>Check connected devices
adb devicesTV testing commands
# 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=briefAnti-patterns
- Running
./gradlew assembleDebugfrom a subdirectory. Always run from project root wheregradlewlives. - Using
gradleinstead of./gradlew. System Gradle may be a different version and break the build. - Building release for development testing. Release builds are slower and not debuggable. Use debug for iteration.
- Skipping
installDebugand manually copying the APK.installDebughandles uninstall-reinstall and is faster. - Not checking
adb devicesbefore install. If no device is connected,installDebugfails silently or with a confusing error.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

