Table of Contents
If you want to send us your comments, please do so. Thanks
More on comments
adb and fastboot
Copied from the LineageOS adb fastboot guide page and updated with our experiences and use on Debian
For installation on Windows 10 have a look on this page
This subject is licensed under CC BY-SA 3.0
If you did not came here from the LineageOS page please have a look there first
Where “device” is mentioned, most of the time a smartphone is ment. In our case a Xiaomi Pocophone F1
About ADB and fastboot
What is ADB (Android Debug Bridge)?
The Android Debug Bridge (adb) is a development tool that facilitates communication between an Android device and a personal computer. This communication is most often done over a USB cable, but Wi-Fi connections are also supported
adb is like a “Swiss-army knife” of Android development. It provides numerous functions that are described in detail by the command adb --help. Some of the more commonly used commands are listed in the “popular adb commands” section below
Installing adb and fastboot on Debian
With aptitude
- Open a terminal
- Login as root
- Run aptitude install android-tools-adb
- Run aptitude install android-tools-fastboot
- Run adb --version
- On Debian 10.9 Buster this yields
Android Debug Bridge version 1.0.39 Version 1:8.1.0+r23-5 Installed as /usr/lib/android-sdk/platform-tools/adb
- Run fastboot --version
- On Debian 10.9 Buster this yields
fastboot version 1:8.1.0+r23-5 Installed as /usr/lib/android-sdk/platform-tools/fastboot
From Google zip files
Google hosts zips which include only adb and fastboot. You can set adb and fastboot up for use with the instructions below
- Open a terminal
- Login as root
- Download the Linux zip from Google to /opt
- cd /opt
- unzip platform-tools_r31.0.2-linux.zip
- mv platform-tools Android-ADB-platform-tools
- Add the following to /root/.profile
if [ -d "/opt/Android-ADB-platform-tools" ] ; then export PATH="/opt/Android-ADB-platform-tools:$PATH" fi
- Log out and back in
- You may also need to set up udev rules: see this repository for more info
- Open a terminal
- Log in as root in the terminal
- cd /opt
- Clone this repository: git clone https://github.com/M0Rf30/android-udev-rules.git
- If git is not on your computer install git with aptitude install git
- cd android-udev-rules
- Copy rules file: cp -v 51-android.rules /etc/udev/rules.d/51-android.rules
- OR create a sym-link to the rules file - choose this option if you'd like to update your udev rules using git. ln -sf “$PWD”/51-android.rules /etc/udev/rules.d/51-android.rules
- Change file permissions: chmod a+r /etc/udev/rules.d/51-android.rules
- Add the adbusers group if it's doesn't already exist: groupadd adbusers
- cp android-udev.conf /usr/lib/sysusers.d/
- systemd-sysusers
- Add your user to the adbusers group: gpasswd -a $(whoami) adbusers
- Restart udev:
- udevadm control --reload-rules
- systemctl restart systemd-udevd.service
- Start the ADB server adb start-server
- To stop, not needed here, the ADB server (back to Debian again): adb kill-server
- Do /opt/adb --version. We got
Android Debug Bridge version 1.0.41 Version 31.0.2-7242960 Installed as /opt/Android-ADB-platform-tools/adb
- Run /opt/fastboot --version
- The result should be something like
fastboot version 31.0.2-7242960 Installed as /opt/Android-ADB-platform-tools/fastboot
If flashing the LineageOS recovery does not seem to work
Make sure you booted the device this way
- You are in the FASTBOOT screen
- Press Volume up + Power buttons
- Wait until POCO appears on the screen
- Now the LineageOS recovery should be started
- If that does still boot into the device's stock recovery, for the Pocophone F1 “Main Menu MI-Recovery 3.0
- Try installing adb and fastboot via the Debian repository: android-tools-adb and android-tools-fastboot
- This might help
Setting up berryllium for use with adb
To use adb with your device, you’ll need to enable developer options and USB debugging. The original USB debugging page can be found here. How developer options and USB debugging are enabled is described in this sequence:
- Open Settings, and select “About”
- We could not find about. We found “About phone”
- Tap on “Build number” seven times
- We could not find “Build number” not in “About phone” nor anywhere else in the device
- In “About phone” we got, by tapping 4 times on “Kernel version” the CIT menu with a lot of system test features
- Tapping 7 (we think, because when doing it again we got the message “No need, you are already a developer”. So we must have done it right while searching for and trying the right item but did not notice it) times on the “MIUI version(For POCO)” we could enable developer mode
- Go back to the Settings screen
- Go to ”… Additional settings“
- Select “Developer options”
- “Developer options” should be turned on already
- We also turned on “OEM unlocking”
- Scroll down until the chapter “DEBUGGING”
- Turn “USB debugging” on
- Connect your Android device to an USB port on the computer
- You get a slide-up on the bottom of the screen asking to “Use USB for” with
- “No data transfer” (pre-selected)
- “File Transfer”
- “Transfer photo's”
- A “Cancel” button
- Tap on “No data transfer”
- Verify that USB debugging is enabled in developer options. See step 4.
- Open a terminal/command prompt
- Login as root
- Type adb devices and do ENTER
- The output is something like
# adb devices * daemon not running; starting now at tcp:5037 * daemon started successfully List of devices attached abcdef12 unauthorized
- On the device you get a slide-up mentioning:
- “Allow USB debugging?”
- The computers RSA fingerprint
- “Always allow from this computer”
- This is turned on. If not, turn this on
- “Cancel” and “OK” (blue) button
- Tap on the “OK” button
- Type adb devices and do ENTER
- You should now see your device in the terminal. Something like
# adb devices List of devices attached abcdef12 device
- Congratulations! adb is now ready to use with your device
Old version
- Enable developer options on your device so you are able to use adb with your device
- Open Settings
- Select “About”
- Tap on “Build number” seven times
- Go back
- Select “Developer options”
- Enable USB debugging
- Scroll down, and check the “Android debugging” entry under “Debugging”
- Plug your device into your computer
- On the computer, open up a terminal/command prompt and type adb devices
- A dialog should show on your device, asking you to allow usb debugging. Check “always allow”, and choose “OK”
- Congratulations! adb is now ready to use with your device
Setting up Fastboot
- With the device powered off, press the Volume Down and Power buttons
- Keep holding both buttons until the word “FASTBOOT” appears on the screen, then release
- Now the device boots into Fastboot (this is also valid for the Bootloader Download)
- While in fastboot mode, you can type fastboot devices in the terminal to verify that your device is being detected. The result should be something like
aa5e1b5e fastboot
Popular adb commands
Command | Explanation |
---|---|
adb shell | Launches a shell on the device |
adb push <local> <remote> | Pushes the file <local> to <remote> . Example: adb push /home/user/hello.txt /sdcard/Downloads |
adb pull <remote> [<local>] | Pulls the file <remote> to <local>. If <local> isn’t specified, it will pull to the current folder |
adb logcat | Allows you to view the device log in real-time. You can use adb logcat -b radio to view radio logs, and adb logcat -C to view logs in colour |
adb install <file> | Installs the given .apk file to your device |
Useful links
Unlock bootloader
Unlock bootloader
Main subjects on this wiki: Linux, Debian, HTML, Microcontrollers, Privacy
RSS
Disclaimer
Privacy statement
Bugs statement
Cookies
Copyright © : 2014 - 2024 Webevaluation.nl and the authors
Changes reserved.