One of the most used mobile operating systems today is Android which is developed by Google and within its different functionalities we find the versatility of configuration, security, design and compatibility with hundreds of devices. Within the world of mobile systems is a very interesting section, which has a direct impact on the scalability of Android , and is the development of applications, we know that it is a world of characters, symbols and signs where the slightest error gives as a result that the code execution is not carried out correctly but if everything goes as expected we can create unique applications with great benefits for thousands of Android users , well, in order to facilitate this task of development, Android has arranged for free the ADB utility, which is available for the main operating systems used today..
TechnoWikis will explain what it is and how to install ADB and fastboot on these systems and thus have one more branch of IT to make use of Android.
What is ADB?
ADB (Android Debug Bridge), has been developed as a command line tool that has great features and thanks to which it will be possible to establish communication with an instance of an emulator or an Android device that connects directly to the used equipment.
Thanks to ADB, it will be possible to perform different and varied actions on Android devices such as the installation and debugging of apps, against access to a Unix shell terminal in which it will be possible to execute several commands on the connected emulator or device to see how It would work in a productive environment..
ADB features
ADB is developed as a client-server program in which three basic components for its use are included:
- A client which is in charge of sending the commands, this client is executed in the development team, this client can be invoked from the command line terminal thanks to a specific ADB command for it.
- A daemon, which is responsible for executing the commands on the device. The daemon is executed as a background process in each instance of the emulator or device to use.
- A server whose task is to manage communication between the client and the Daemon this server runs as a background process in the development machine.
The adb tool is in the path "android_sdk / platform-tools /".
ADB operation
At the time an ADB client is started, this client must first check if there is an ADB server process currently running, if it is not, the server process starts. At the moment the server starts, it is linked to local TCP port 5037 and from there it looks for commands sent by ADB clients, it should be noted that all ADB clients use port 5037 to communicate with the server of ADB.
Once the communication process is completed, the server establishes connections with all instances of emulators or devices that are being executed and there it locates instances of emulators or devices carrying out port scanning tasks with odd numbers using the range of 5555 at 5585, this range is used by emulators and devices..
What is Fastboot?
Fastboot is a tool developed by Android which is useful for flashing files and modifying some software factors that are predetermined on the computer, it does not hurt to indicate that the use of this utility is careful since something badly executed will have a negative impact throughout the operation of the Android system.
One of the advantages of using Fastboot is that it will be possible to unlock the bootloader in order to change the ROM of the terminal.
To enter Fastboot normally use the power button + the vol up key.
1. Install ADB with fastboot on Windows 10
Before we can see how we can download ADB and use it, we must carry out a series of previous steps on our Android mobile so that everything works correctly.
Step 1
The first step to take will be to go to the phone settings and then click on the “About phone†line which is in the final part of the settings as we see:
Step 2
In the new window we locate the section "Kernel version":
Step 3
There we must press 7 times on this section to enable Android developer mode, after this, we go to the “Developer options†section and we must click on the “USB Debugging†line switch, the following message will be displayed. There we click on the "Accept" button in order to enable this mode on Android. We leave you an example tutorial so you can see it more clearly.
Step 4
Now we proceed to the installation itself. For Windows operating systems we must first download the ADB utility in the following link:
ADB Windows 10
Step 5
We proceed to extract the contents of said compressed file:
Step 5
There we found the entire ADB suite where fastboot is included. Now we extract this content in the path "C: \ Windows":
Step 6
When executing this, we will have the platform tools directory on drive C and from there it will be possible to run ADB. Alternatively, it will be possible to install ADB on Windows 10 using the following method, there we must go to the following route:
Step 7
There we click on the “Advanced system configuration†line and in the pop-up window we will go to the “Advanced options†tab and there we click on the “Environment variables†button located at the bottom:
Step 8
The following will be displayed:
Step 9
There we select the “Path†line and click on the “Edit†button, the following will be displayed:
Step 10
There we click on the "Browse" button and enter the path where the downloaded ADB content has been extracted. Click on OK to save the changes. Another useful method in Windows 10, is to go directly to the downloaded content and somewhere free press the Shift key, right click and select the option "Open the PowerShell window here":
Step 11
Now it is time to connect our Android device to Windows 10 and there, in USB mode, select the "Files" option:
Step 12
By selecting this option we will go to the PowerShell console that has been opened and execute the following:
adb devices
Step 13
As we see there, two basic actions are carried out:
- Start of the ABD daemon using port 5037
- Detection of Android devices connected to the device
Step 14
In the first time we carry out this process, it applies to Linux and macOS too, we can see that the computer is not authorized, so we will see the following message on the Android device:
Step 15
There we click on OK to allow the fingerprint. Now we can see that the equipment is authorized in ADB:
2. Install ADB and fastboot on Linux
For this case we will use Ubuntu 18.04, in the case of Linux we have two methods to install ADB.
Note
In case of using a 64-bit edition it will be necessary to install the glibc.i686, libstdc ++ packages.
Step 1
In Linux we must first download ADB in the following link:
ADB Linux
Step 2
We proceed to extract the downloaded content, after this, we open a terminal console and go to the home directory where we run the following line:
sudo nano .bashrc
Step 2
In the deployed file we will enter the following syntax at the end of it:
export PATH = $ {PATH}: / home / â€user†/ Path to ADB
Step 3
We save the changes using the following key combination:
+ O Ctrl + O
We leave the editor using:
+ X Ctrl + X
Step 4
After this we run adb to access the connected devices. Now, another method to use in Linux is to install it directly on the console, for this we first execute the following:
sudo apt install adb
Step 5
Enter the letter S to confirm the download and installation of ADB.
Note
In the case of using CentOS or fedora we execute the following:
sudo yum install android-tools
Step 6
Now we will execute the following:
adb devices
Step 7
As we see, first, the ADB daemon is enabled. Again we execute adb devices, when the equipment has been connected, so that the active devices are listed:
3. Install ADB and fastboot on macOS Mojave
Step 1
In the case of macOS Mojave we must first download the utility in the following link.
ADB macOS Mojave
Step 2
After this, we extract the content, open a taemrinal and execute the following syntax:
cd / route ADB
Step 3
Once we access there, just run adb devices to list the connected devices. Now, in case this method generates error, we can use HomeBrew for the installation of ADb, this is a package manager for macOS.
First, we install HomeBrew with the following command:
ruby -e "$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Step 4
There we press the Enter key to start the installation process. Now we are going to install ADB by running the following:
brew cask install android-platform-tools
Step 5
We can see that the ADB download process starts:
Step 6
Once this process is finished we will see the following:
Step 7
We activate the service by running adb devices:
Step 8
Now we connect the equipment to macOS Mojave and again run adb devices so that it is listed:
Step 9
From this point we are able to use ADB together with fastboot on Android and thus explore a universe of new development possibilities. The ADB connection status, on all systems, can be any of the following:
- offline: indicates that the instance is not connected to ADB or does not respond.
- device: this option indicates that the instance is connected to the ADB server.
- no device: there is no emulator or device connected.
Step 10
Some useful commands that we can use with fastboot are:
Check that the mobile is connected
Flashing a ROM
fastboot flash (name of the rom) .zip
Flashing a recovery
fastboot flash recovery recovery.img
Flashing a kernel
fastboot flash boot boot.img
Boot into recovery mode
fastboot boot recovery.img
Step 11
Some basic ADB commands are:
Copy a file from mobile to computer
Send a file to our mobile device
Install an .apk application on your mobile
Restart the mobile in normal mode
Restart the phone in bootloader mode or in recovery mode
adb reboot-bootloader / reboot recovery
With ADB and fastboot we have at hand a series of complete and functional utilities to increase the ability to use Android completely.