Adb in linux path

How do I set up Android ADB?

My computer is a Sys76 Lemur running Maverick, and my phone is a Nexus S running stock Gingerbread. I want to set up to use ADB (android debug bridge). I installed the Android SDK per instructions on the SDK website, but ADB doesn’t work. Can someone help me with directions that are specific to Ubuntu?

As of October 2017, all other answers are outdated. You can download ADB and fastboot directly from developer.android.com.

6 Answers 6

Install adb & fastboot via PPA

You can install from the WebUpd8 PPA which support both 32-bit and 64-bit. Granted you can install directly from google. But I prefer to use PPAs to keep everything up to date.
Works for Ubuntu 11.04, 11.10 and 12.04.

sudo add-apt-repository ppa:nilarimogard/webupd8 sudo apt-get update sudo apt-get install android-tools-adb android-tools-fastboot 

Install Android SDK via PPA

If you want to install the SDK which will allow you to update everything you can install via the upubuntu ppa.

So first thing is to add the ppa.

sudo add-apt-repository ppa:upubuntu-com/sdk sudo apt-get update sudo apt-get install android-sdk 

Only issue at this point is that android-sdk needs to be run as root. Well the link in the menu didn’t do much. So I updated the link in the menu, you can also run:

From there you will need to install «Android SDK Platform-Tools» I also recommend updating «Android SDK Tools». You can deselect anything else you don’t need.

Now you will need to set your environmental variables.
First you will need to make everything executable.

sudo chmod -R 755 /root/android-sdk-linux 

Add these lines (at the top)

#AndroidDev PATH export PATH=$:/root/android-sdk-linux/tools export PATH=$:/root/android-sdk-linux/platform-tools 

Источник

Читайте также:  Bad blocks fix linux

Install ADB On Linux

ADB on Linux

In this tutorial we will be installing ADB (Android Debug Bridge) on your linux computer and making it accessible from any directory. ADB provides a terminal interface on your linux computer to interact with your android device file system. This can be useful for many things like installing and uninstalling apps, disabling and enabling apps , logcat, and many other things.

Install ADB

  1. Open your terminal by pressing (ctrl+alt+T) on your computer keyboard or by clicking its launcher icon.
  2. Create a directory named (adb) in your linux Home directory. You can run this command in terminal to create the directory:
# Android platform-tools export PATH=$:~/adb/platform-tools

If all went well you should get an output in your terminal with the adb version number. You have now installed adb on your linux computer.

Test ADB with Android

Now that you have adb installed on your linux computer you should test it with your android to make sure adb recognizes your android device.

  1. Make sure you have (USB debugging) enabled on your android device in the Settings (Developer options).
  2. Plug your android device to your computer with the usb cable.
  3. Now open a terminal on your computer and run the following command:

You will now see a terminal output with your android device serial number which will look similar to the output below.

List of devices attached c4fec245 device

Conclusion

You should now have adb installed on your linux computer and ready to interact with your android devices. For more adb commands and options you can run (adb help) in your terminal.

Источник

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.

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.

    Источник

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