Essential ADB and Fastboot Commands for Quectel Pi Development and Debugging
Overview
ADB (Android Debug Bridge) and Fastboot are two of the most commonly used tools when developing, debugging, and maintaining Quectel Pi platforms.
Whether you need to access the device shell, collect logs, transfer files, install applications, or recover a device through Fastboot, these tools provide a convenient interface between the host PC and the target device.
This article summarizes commonly used ADB, Fastboot, Dumpsys, Activity Manager (AM), and Package Manager (PM) commands that can help streamline development and troubleshooting activities.
1. ADB (Android Debug Bridge)
ADB allows communication with a running Android-based system over USB or TCP/IP.
Device Connection
Check Connected Devices
adb devices
Displays all devices currently detected by ADB.
Connect to Device over Network
adb connect <ip>:<port>
Example:
adb connect 192.168.1.100:5555
Useful for remote debugging when USB access is not available.
Device Access
Open Device Shell
adb shell
Provides direct access to the device command line.
Restart ADB Service
adb start-server
Stop ADB Service
adb kill-server
These commands are useful when troubleshooting device detection issues.
Reboot Commands
Reboot Device
adb reboot
Reboot into Fastboot Mode
adb reboot bootloader
Reboot into Recovery Mode
adb reboot recovery
Reboot into EDL Mode
adb reboot edl
EDL (Emergency Download Mode) is commonly used when performing firmware upgrades through QFIL.
Root and System Access
Restart ADB as Root
adb root
Disable Android Verity
adb disable-verity
Remount System Partition as Writable
adb remount
Note:
adb remounttypically requiresadb disable-verityto be executed first.
Application Management
Install APK
adb install example.apk
Uninstall Application
adb uninstall com.android.settings
File Transfer
Push Files to Device
adb push test.txt /sdcard/
Pull Files from Device
adb pull /sdcard/test.txt ./
These commands are useful for transferring logs, configuration files, and application packages.
Log Collection
Capture Android Logs
adb logcat
Save Logs to File
adb logcat -b all > Android.txt
Generate Bug Report
adb bugreport
The generated report can be attached when submitting technical support requests.
2. Fastboot Commands
Fastboot provides low-level access to the device bootloader and is commonly used for flashing images and device recovery.
Verify Device Detection
fastboot devices
Confirms that the device is detected while in Fastboot mode.
Flash Partitions
fastboot flash <partition> <image>
Example:
fastboot flash boot boot.img
Commonly used for updating boot, vendor, or recovery partitions.
Erase Partitions
fastboot erase userdata
Useful when performing factory resets or preparing a clean test environment.
Retrieve Bootloader Information
Display Specific Variable
fastboot getvar version
Display All Variables
fastboot getvar all
Useful for collecting bootloader information during debugging.
Reboot Device
fastboot reboot
Reboots the device back into the operating system.
3. Dumpsys Commands
The Dumpsys utility provides detailed information about Android system services.
Memory Information
adb shell dumpsys meminfo
Displays memory consumption statistics.
CPU Usage
adb shell dumpsys cpuinfo
Displays CPU utilization by process.
Activity Information
adb shell dumpsys activity
Shows running activities and task information.
Package Information
adb shell dumpsys package com.android.settings
Displays detailed information for a specific package.
Graphics Information
adb shell dumpsys gfxinfo
Useful for analyzing UI rendering performance.
Display Information
adb shell dumpsys display
Provides display configuration and status information.
Power Information
adb shell dumpsys power
Displays power management status.
Battery Information
adb shell dumpsys battery
adb shell dumpsys batterystats
Useful when investigating battery-related issues.
Alarm Manager Information
adb shell dumpsys alarm
Displays scheduled alarms and wake-up events.
Location Service Information
adb shell dumpsys location
Provides information about active location providers and requests.
4. Activity Manager (AM) Commands
The Activity Manager tool can be used to launch applications, services, and broadcasts.
Start an Activity
adb shell am start com.android.settings/.Settings
Start a Service
adb shell am startservice com.example/.MyService
Stop a Service
adb shell am stopservice com.example/.MyService
Send a Broadcast Intent
adb shell am broadcast -a com.example.TEST
Kill a Specific Application
adb shell am kill com.android.settings
Kill Background Processes
adb shell am kill-all
5. Package Manager (PM) Commands
Package Manager commands are useful when investigating installed applications.
List Installed Packages
adb shell pm list packages
Show APK File Paths
adb shell pm list packages -f
Show Enabled Packages
adb shell pm list packages -e
Show Disabled Packages
adb shell pm list packages -d
Show System Applications
adb shell pm list packages -s
Show Third-Party Applications
adb shell pm list packages -3
Show Installer Information
adb shell pm list packages -i
Show Package UIDs
adb shell pm list packages -U
Conclusion
ADB and Fastboot are essential tools for working with Quectel Pi platforms. They provide capabilities ranging from device management and application deployment to system diagnostics and firmware recovery.
For daily development and troubleshooting, the commands covered in this guide can significantly simplify tasks such as:
-
Device connectivity verification
-
File transfer
-
Application installation
-
Log collection
-
System diagnostics
-
Firmware recovery
-
Package management
Keeping these commands readily available can help accelerate debugging and reduce development time when working with Quectel Pi devices.