This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
你已经有的东西(全部齐全)
✅ build-tools/34.0.0 → Android 14 编译工具✅ platforms/android-34 → Android 14 系统库✅ platform-tools → adb 等工具✅ cmdline-tools → SDK 管理工具
这就是完整的 Android SDK 环境!
现在你只需要 2 步就能编译 APK
第一步:设置环境变量(告诉 Gradle 你的 SDK 路径)
执行这 2 条命令:
bash
运行
export ANDROID_HOME=/data/Code/tools
export ANDROID_SDK_ROOT=/data/Code/tools
如果想永久生效:
bash
运行
echo "export ANDROID_HOME=/data/Code/tools" >> ~/.bashrc
echo "export ANDROID_SDK_ROOT=/data/Code/tools" >> ~/.bashrc
source ~/.bashrc
第二步:进入你的 Android 项目,执行编译
进入你的 Android 项目目录(必须有 gradlew)
bash
运行
chmod +x gradlew
编译 Debug 包
bash
运行
./gradlew assembleDebug
Description
Languages
Text
100%