Build, install, and launch the Zhihu++ Android app on a connected device using ADB. Includes comprehensive troubleshooting for common issues like missing devices, installation failures, signature mismatches, and app crashes. Use when deploying debug builds to physical devices or emulators.
This skill documents how to build, install, and launch the Zhihu++ Android app on a connected device using ADB (Android Debug Bridge).
# 1. Build the lite debug APK
./gradlew assembleLiteDebug
# 2. Install and launch on device
adb install -r ./app/build/outputs/apk/lite/debug/app-lite-debug.apk
adb shell am start -n com.github.zly2006.zhplus.lite/com.github.zly2006.zhihu.MainActivity
# Check if adb is available
which adb
# Check adb version
adb --version
# List connected devices
adb devices
Expected output:
List of devices attached
<device-id> device
cd /path/to/Zhihu
./gradlew assembleLiteDebug --quiet
The APK will be generated at: ./app/build/outputs/apk/lite/debug/app-lite-debug.apk
# Install with -r flag to replace existing installation
adb install -r ./app/build/outputs/apk/lite/debug/app-lite-debug.apk
Expected output: Success
# Launch the main activity
adb shell am start -n com.github.zly2006.zhplus.lite/com.github.zly2006.zhihu.MainActivity
Expected output: Starting: Intent { cmp=com.github.zly2006.zhplus.lite/com.github.zly2006.zhihu.MainActivity }
The project has two build variants:
Lite Version (recommended for development)
com.github.zly2006.zhplus.lite./app/build/outputs/apk/lite/debug/app-lite-debug.apkcom.github.zly2006.zhihu.MainActivityFull Version
com.github.zly2006.zhplus./app/build/outputs/apk/full/debug/app-full-debug.apkcom.github.zly2006.zhihu.MainActivitySymptom: