?? Master AOSP Utility Commands: Turbocharge Your Workflow! ??
Vikash Choudhary
Engineering Professional | Custom ROM Development, Android Development & Framework (AOSP) | Android Automotive (AAOS) | IoT & Embedded Linux | Technical Blogger |
If you're an AOSP developer, these utility commands are your best friends! They streamline debugging, building, and managing code, letting you focus on creating amazing solutions. Whether you're working on the core Android platform or custom Android Automotive solutions, these commands are indispensable.
Here are 10+ examples that can save you time and effort:
?? 1. lunch
Set up your build environment.
lunch aosp_<device>-userdebug
Example:
lunch aosp_<device>-userdebug
This preps your build system for an Android emulator or device-specific build.
?? 2. repo
Manage multiple repositories easily:
repo init -u https://android.googlesource.com/platform/manifest -b master
repo sync -j16
?? 3. m / mm / mmm
m droid
mmm frameworks/base
mm
?? 4. adb (Android Debug Bridge)
Interact with your device or emulator:
adb forward tcp:9222 localabstract:webview_devtools_remote
adb shell screencap /sdcard/screenshot.png
adb pull /sdcard/screenshot.png
adb shell screenrecord /sdcard/demo.mp4
adb pull /sdcard/demo.mp4
?? 5. fastboot
Critical for flashing and debugging:
fastboot flash system system.img
fastboot reboot recovery
?? 6. dumpsys
A goldmine for inspecting system services:
领英推荐
adb shell dumpsys meminfo com.example.myapp
adb shell dumpsys battery
adb shell dumpsys activity activities
?? 7. logcat
Real-time system logging made easy:
adb logcat MyAppTag:D *:S
adb logcat > logs.txt
?? 8. aapt (Android Asset Packaging Tool)
For inspecting APKs and resources:
aapt list -v myapp.apk
aapt dump badging myapp.apk
?? 9. emulator
Launch and customize Android emulators:
emulator -avd Pixel_4_API_30
emulator -avd Pixel_4_API_30 -gpu host
?? 10. perfetto
System tracing for performance profiling:
adb shell perfetto --config=/data/misc/perfetto/config.pb --out=/data/misc/perfetto/trace_output
adb pull /data/misc/perfetto/trace_output
?? 11. gdbclient
Debug native code with gdb:
gdbclient app_process
?? 12. traceview
Visualize execution times:
traceview trace.trace
#AndroidDevelopment #AOSP #AndroidAutomotive #DeveloperTools #TechTips #Programming