Android adb fastboot linux

How to Install ADB & Fastboot on Ubuntu 20.04, 18.04, 21.04

This tutorial is going to show you how to install ADB & fastboot on Ubuntu 20.04, 18.04, 21.04, which is quite easy.

What are ADB and Fastboot

ADB and fastboot are two components of the Android SDK Platform-Tools.

ADB stands for Android Debug Bridge. It’s a command-line utility that allows you to do the following stuff:

  • Control your Android device over USB from your computer
  • Copy files back and forth
  • install and uninstall apps
  • run shell commands
  • and much more

Fastboot is a command-line tool for flashing an Android device, boot an Android device to fastboot mode, etc…

How to Install ADB and Fastboot on Ubuntu 20.04, 21.04, 18.04

It’s super easy. Simply run the following commands in a terminal window to install them from Ubuntu repository.

sudo apt update sudo apt install android-tools-adb android-tools-fastboot
Android Debug Bridge version 1.0.32

Enable USB Debugging on Your Android Device

While your Android device is unplugged from USB, go to your Android settings, scroll all the way down and tap About phone or About device . Then tap Build number 7 times which makes you a developer.

Now go back to the settings, you will see a new button called Developer options . Tap that button and enable USB debugging.

Test the Installation

To check if ADB is working properly, connect your Android device to your Ubuntu computer via USB cable. After that, type the following command in your Ubuntu terminal window.

You will be prompted to allow USB debugging from an Ubuntu computer like the screenshot below. Select OK.

adb ubuntu

Then type run adb devices command again and your Android device will show up.

adb ubuntu install

If you get the following error,

Then all you need to do is restart adb daemon, run

Wrapping Up

I hope this tutorial helped you install adb and fastboot on Ubuntu 20.04, 21.04 and Ubuntu 18.04. You may also want to read:

As always, if you found this post useful, then subscribe to our free newsletter to get more useful tutorials.

Источник

How to Install ADB and Fastboot on Linux

If you’re an Android enthusiast, you’ve most probably heard of ADB & Fastboot. If I had to bet I’d bet that you’ve most probably even used them. Android is very customizable but there are certain things that you still can’t do without root access. Yet, there are certain things that you can do without root access but you need ADB & Fastboot. From backing up your device to changing screen resolution or even flashing custom recoveries, unlocking the bootloader, ADB and Fastboot have a lot of uses. We’ve seen how you can install ADB & Fastboot on Windows before. Windows isn’t the only desktop OS around though. There are several others based on Linux, just like Android. Here’s how to setup or install ADB and Fastboot on Linux.

Читайте также:  Linux вывести атрибуты файла

Download ADB for Linux

The best way to install ADB and Fastboot on Linux or any other OS would be to install the Android SDK Tools. It comes with ADB and Fastboot bundled and is also regularly updated by Google. You can download the zip from the download link below.

How to install ADB and Fastboot on Linux

  1. Extract the downloaded zip file to an easy to access location such as the desktop. This downloaded folder contains all the files necessary to run ADB & Fastboot and requires no further installation. To use ADB & Fastboot though you will need to access this folder from a Terminal.
  2. Open the Terminal by pressing Ctrl+Alt+T or via whichever app launcher or method you prefer.
  3. In the Terminal, access the extracted folder by using this command:
cd /home/username/Desktop/platform-tools_r27.0.1-linux/platform-tools

How To Install ADB & Fastboot On Linux

Alternatively, you can open the folder using Nautilus, which is the default file manager on most Linux distros, right-click on an empty area and select Open in Terminal.

  • Connect your Android device to your Linux PC with a USB cable now. On your device select the MTP file transfer mode. Some devices allow ADB to function without an MTP connection but unless you’re sure your device is one of those, it is safe to go with the MTP file transfer mode.
  • In the Terminal, enter the following command and it will trigger a prompt on your connected Android device.

  • On your Android, you should see a prompt asking you to allow USB debugging permissions to the connected PC. Go ahead and grant it. How To Install ADB & Fastboot On Linux
  • Repeat the command given above and you should now see your device listed along with its serial number.How To Install ADB & Fastboot On Linux
  • Add ADB & Fastboot system-wide (Optional)

    1. In a Terminal, enter the following command to open the .bashrc file in a Text editor of your choice. The command below will open the file in gedit.
    export PATH=$PATH>:/home/YOUR-USERNAME/path/to/adb

    Install ADB & Fastboot via Terminal commands

    While the above method will work for every Linux distro, it is not the best way to install ADB & Fastboot on all Linux distros. Some Linux users can have a more hassle-free, system-wide ADB & Fastboot installation. Users who have a Debian or Fedora/SUSE-based distro of Linux need not download the above linked platform-tools folder. Simply launch a Terminal and enter one of the following commands depending on the Linux distribution you use.

    • Debian-based Linux users can type the following command to install ADB: sudo apt — get install adb
    • Fedora/SUSE-based Linux users can type the following command to install ADB: sudo yum install android — tools

    For the uninitiated, Ubuntu, the most popular Linux distribution and its various official flavors and derivatives are all Debian based. Also, while Ubuntu users need not worry, there’s one other thing that you should keep in mind if you’re using other Linux distributions. If you’re using such a distribution, you probably already know but you may have to type a ./ before every ADB command. For instance, the adb devices command used above should be typed as below.

    Источник

    How to install and use ADB and Fastboot on Ubuntu

    ADB (Android Debug Bridge) and Fastboot allow us to manage Android mobile devices from the computer. After reading this tutorial, you’ll know how to install and use ADB and Fastboot to control your Android cell phone.

    Getting started: Installing ADB, Fastboot, and getting your Android device ready

    Before starting, you need to enable your phone Developer Options submenu. I have a Redmi 9 cell phone, but the steps are similar in most Android devices.

    To start, on your phone, tap Settings and select About Phone; in the screenshot below, it is the first option; some Android devices have this option at the bottom of the Settings menu.

    Tap MIUI Version several times until you see Developer Options are enabled.

    Go back to the Settings menu, scroll down to find, and tap Additional Settings.

    Would you please scroll down to find Developer options and tap it?

    Enable USB Debugging as shown in the following screenshot.

    Tap the confirmation box “I’m aware of possible risks, and assume all possible consequences voluntarily” and press OK.

    Now you can install ADB and Fastboot from your Ubuntu computer.

    First, install Android Debug Bridge and Fastboot using the apt command as shown in the screenshot below.

    To start the ADB server, run the following command.

    Your phone device allows USB debugging when requested by tapping OK, as shown in the image below. In some cases, this prompt on the mobile appeared in the next step.

    To see if your device was properly detected, you can run the following command.

    As you can see, the device was detected properly.

    You can open a shell on your Android device by running the command below.

    As you can see, the pwd command shows I’m in the system root directory. The ls command will list all files and directories inside. You can browse all directories using the same Linux syntax.

    Transferring files from computer to mobile

    The following command shows how to send files from your computer to your mobile device. To do it, you need to run adb with the push option followed by the file you want to copy to your phone and your phone’s path where the file will be stored.

    The command below is used to copy the img.jpg file to /storage/sdcard0/Pictures/. You can learn file and directory paths by browsing the shell as explained previously (adb shell).

    Transferring files from mobile to computer

    You also can copy files from your mobile device by using the pull option as shown in the example below, in which the file img.jpg is copied into the computer’s current directory (.).

    Installing APK packages

    Adb also allows you to install applications on your mobile device. To do it, you need to enable the Install via USB located in the Developer Options submenu in your phone Settings, as shown in the image below.

    Once the Install via USB option was enabled, you can install any apk supported package by adding the install option followed by the apk package as shown below.

    Your phone will request your confirmation, as shown in the screenshot below; tap Install to get the application installed.

    If the application were properly installed, you would see the “Success” message shown in the following screenshot.

    Uninstalling APK packages

    You also can uninstall applications from your mobile device using your computer. Instead of using the install option explained previously, you need to use the uninstall option.

    Before uninstalling a package, you need to see its name; you can do it by opening a shell on your Android device and running the command of the example below (replace maildroid with the app name you want to find).

    As you can see, the package name is com.maildroid. To remove it, run:

    Additional commands

    The following command can be used to change your phone resolution.

    The command below allows you to edit your mobile’s dpi (dots density or Dots per inch).

    Stock recovery doesn’t support flashing custom ROMs. The Fastboot command below can be used to install a custom recovery such as CWM or TWRP.

    The command below allows you to fully wipe your mobile to install a custom ROM.

    Conclusion

    Both Adb and Fastboot allow users to operate their Android devices from the computer. Learning to use these applications is mandatory for anyone dealing with mobile devices. It is important to highlight that the applications explained in this tutorial are multi-platform, including Linux, MacOS, and Windows.

    I hope this tutorial on Adb and Fastboot was useful. Keep following Linux Hint for more Linux tips and tutorials.

    About the author

    David Adams

    David Adams is a System Admin and writer that is focused on open source technologies, security software, and computer systems.

    Источник

    Оцените статью
    Adblock
    detector