Adb is not an internal or external command. What are the Adb and Adb run programs - basic commands and how to use them


Almost every owner Android device who decided to improve his pet by replacing the firmware or kernel operating system, collides with the program adb.

For most beginners, it is this program that becomes an insurmountable obstacle, and today we will tell you how to install and start working with this wonderful application, which will help you, for example, get root rights on your device, flash new versionAndroid or even restore your phone or tablet to its original state after unsuccessful system intervention.

So what is it A.D.B. loved by all modders and hackers, where can we get it, and why do we need it?

What is ADB.

Abbreviation A.D.B. stands for Android Debug Bridge(Android debug bridge). ADB is integral part, which can be downloaded from here .

Since the operating system Android is a variety Linux, to configure it you often need to work through the command line. Of course, there are programs - terminal emulators that allow you to execute commands directly on the device, but, firstly, it is inconvenient to do this on a small phone screen, and secondly, sometimes you need access to the device via a computer, and in these and many other cases the program adb simply irreplaceable. Program adb establishes a connection between the device and the computer and allows you to perform various manipulations with the system directly on the computer Android.

How to install ADB.

First of all, we recommend that you download the most latest version, at the time of writing this guide, the version available is r11, all further descriptions are based on her example, and more earlier versions, location necessary programs after installation SDK, may differ from what is described here.

1. Download it, it can be found at the link provided earlier. There are several varieties SDK, For Microsoft Windows,MacOS And Linux.

We need a variety for Microsoft Windows. And here there are two options - download the installer or zip archive With Android SDK. We don’t need an installer, especially since it won’t allow us to install SDK V Windows 7, and therefore download the zip archive.

The archive contains a folder android-sdk-windows, which itself contains SDK. Unpack it onto your computer. In our example, we placed the folder at the root of drive C. If you do the same, the path to SDK we will have this: C:\android-sdk-windows

In earlier versions SDK inside this folder in a folder tools the program we needed was located adb, but later it was moved by the developers to the folder platform-tools.

However, if you go to this folder, you will not find the program inside it adb, so let's move on to the next installation step.

2. Install SDK Platform Tools.
We make sure that our computer is connected to the Internet and launch the folder located android-sdk-windows, program SDK Manager. After starting the program, the following window will appear:

We need to download and install Android SDK Platform-tools And Android SDK Tools.

By double clicking on an item or by clicking on “ Accept" And " Reject» Check these two items in the list and uncheck all other items, as shown in the above screenshot. Then click " Install"and wait until the components we need are downloaded and installed.

Now we have installed adb on your computer, but to work with our phone or tablet you will need to install their driver and for further convenience with the program, it would be nice to write the path to it and other components in the Windows system.

3. If we go to the folder C:\android-sdk-windows\platform-tools\, we can now find the program there adb.

After this, we need to edit the PATH system variable so that every time we start the program and enter commands we do not have to type the path to the program, which looks like this:

C:\android-sdk-windows\platform-tools\adb

If you have never edited system variables, create a system restore point so that you can later return it to its original state.

If you have installed Windows 7, right-click on the shortcut “ Computer", select " properties" and in the window that opens select " Extra options systems».

If you have Windows XP, click right click mouse on " My computer" and then by " Properties»

In the next window on the tab " Additionally» click on the button « Environment Variables " In the list " System Variables"select a variable" path" and press the button " Change…»

The variable editing window will open, and in paragraph “h” variable value"at the very end of the line, after the semicolon, add the path to the folder tools and folder platform-tools:

;c:\android-sdk-windows\tools;c:\android-sdk-windows\platform-tools;

(if there was no semicolon at the end of the line, add one - each path in this line must be separated from the other by a semicolon)

If you installed in another folder, write at the end of the line your path to the tools and platform-tools.

Installing device drivers.

Some devices, such as company phones and tablets Samsung have their own software for synchronizing with your computer, and if you have it installed on your computer, then the device driver is already installed on your system.

But for devices like Nexus One, which are supplied without any additional programs and drivers for working with Android SDK, drivers need to be installed.

To do this, go to the folder in which we installed SDK and launch SDK Manager.

Exactly the same as we installed Android SDK Platform-tools And Android SDK Tools, find and select from the list “ Google USB Driver package" Click " Install"and wait while the program downloads the drivers. Drivers for 32 and 64 bit Windows will be downloaded to the following folder:

C:\1\android-sdk-windows\extras\google\usb_driver

You can now install drivers for your device. To do this, in the settings menu of your phone or tablet, select “ Applications"(Applications), and in it we include " USB Debugging "(USB debugging).

We connect our device to the computer. The computer will detect new hardware and prompt you to install drivers. We install the drivers from the folder where they were downloaded earlier.

After installing the drivers, a new device will appear in Device Manager " ADB Interface" and we can verify this by opening it by right-clicking on the icon " Computer» -> « Properties» -> « device Manager»

Additionally, you can try installing a universal ADB driver on your computer.

How to launch ADB

Work with the program adb best way is through the command line Windows. To call command line on a computer with Windows XP, click " Start" and in the input field " Execute» dialing cmd and press “Enter”.

On a computer with Windows 7, click " Start" and in the input field "Find programs and files" we type cmd and press “Enter”.

A command line window will open, and in order, for example, to see what devices we have connected to the computer, we type the command in it

adb devices.

Program adb will display a list of devices connected to currently to the computer.

ADB, or Android Debug Bridge, is a console application for PC that can be used to control the device on Android based straight from your computer. It looks like this: first, ADB tools and drivers for Android are installed on the computer, then mobile device connects to PC via USB cable in debug mode, and finally after launching ADB in the console (command line) executes special teams, initiating certain actions with the gadget. detailed information about the principle of operation of the debugging tool itself is presented on the official website of the developer, so we will not dwell on this, but will immediately move on to the capabilities of ADB and how to install it on a computer.

What does ADB allow you to do?

First, let’s point out why ADB is needed at all. With it you can:

  • Reboot the device in various modes;
  • Exchange files/folders with your phone;
  • Install/uninstall applications;
  • Install custom firmware (including TWRP Recovery);
  • Produce;
  • Execute various kinds of scripts.

The ADB tool is usually installed in conjunction with the Fastboot console application.

Installing ADB and Fastboot from the Android SDK

This method involves using the official development and testing tool Android applications Studio. Go to the page https://developer.android.com/studio/index.html and find the heading “Get just the command line tools”. Below we download the SDK tools archive for Windows (before downloading, we agree to the terms of use).

We unpack the archive to drive C. In our case, the files were extracted to the folder sdk-tools-windows-3859397.

We go to the directory, and then go to the directory tools/bin. Here we are interested in the file sdkmanager, which will help you install ADB and Fastboot on your computer.

Now you need to open the folder with sdkmanager, for which you should run the command in the console cd C:\sdk-tools-windows-3859397\tools\bin, Where C:\sdk-tools-windows-3859397\tools\bin– path to the sdkmanager.

If you unpacked the Android SDK not to drive C, but to some other place, then the full address can be found using top line Explorer (right-click on the destination folder and click “Copy address”).

So we moved to tools\bin and now we need to run the command sdkmanager "platform-tools", which will install the Platform-tools package containing the ADB and Fastboot files.

During installation, please review license agreement and press Y to complete the operation.

If everything went as it should, in the root Android folder SDK directory will appear platform-tools With necessary files adb.exe And fastboot.exe.

Minimal ADB and Fastboot

The second method is even simpler. On the developer forum Xda Developers you can download the package Minimal ADB and Fastboot with all the necessary files. To do this, go to the page https://forum.xda-developers.com/showthread.php?t=2317790 and, by clicking on the link, download the installation exe file.

We launch it and follow the instructions.

We installed Minimal ADB and Fastboot in the root of the same drive C.

Basically, that's all. All that remains is to check the presence of files.

Checking the operation of ADB and Fastboot

After installing applications using any of the above methods, you need to make sure that the utilities are working correctly. To do this, through the command line, go to the folder with the adb and fastboot files (command cd C:\sdk-tools-windows-3859397\platform-tools or cd C:\Minimal ADB and Fastboot), and then run the command adb help. She should print the version installed Android Debug Bridge and list of ADB commands. If you see something similar to the screenshot below, then everything is working correctly.

Now you should connect your mobile device to your PC and check if it sees it adb app. We connect the phone (or tablet) to the computer with via USB-cable, set the mode in the settings MTP connections(file sharing) and go to the section Settings – For Developers.

If there is no such item in the settings, then go to the “About phone” page and click on the line with the build number seven times.

Developer Mode will be activated and the “For Developers” section will become available. Go into it and enable the “USB Debugging” option.

After all these manipulations with the gadget, in the Windows command line, enter the command adb devices. It will display information about the connected device in approximately the same format as in the screenshot.

Thus, we tested ADB and Fastboot and made sure that the Android Debug Bridge is functioning normally, which means that you can now control the phone via a computer.

If communication with the device cannot be established, then you need to check the availability and correct installation of Android drivers. To do this, with debugging mode enabled, go to “Device Manager” and look for exclamation marks in the “ USB devices» item “ADB Interface” (may be called a little differently).

If problems are detected, we try to reinstall the drivers. You can download them on the phone manufacturer’s website or at https://adb.clockworkmod.com/.

We hope that the article was useful to you.

Android OS like any other software, may occasionally fail. And one of these problems is the display of a black screen on the screen of a smartphone or tablet with the inscription Fastboot Mode or Select Boot Mode. Many owners of mobile devices, seeing a similar picture, begin to panic and take the device to the nearest workshop. However, you should not take rash actions, since in most cases you can exit Fastboot Mode yourself. Let's look at what causes Fastboot Mode, what it is on Android and how to get rid of it.

Purpose and causes

Fastboot is effective tool on modification and adjustment of the operating room Android systems, which is included in the set software for developers. Its main task is to install custom firmware. However, this bootloader is also used to install backups, various updates, format a memory card, etc.

Modes Select Boot Mode and Fastboot Mode are not internal or external commands. They start earlier than the operating system itself (like the BIOS on Windows). This allows you to configure the system, as well as fix various problems even if Android has crashed.

Despite its versatility and usefulness, turning on Fastboot on its own may be a sign of a software failure. The main reasons for the appearance of this mode on Android include:

  1. Accidental activation by the user. This tool can be launched manually through the gadget menu.
  2. Android malfunction. If your smartphone or tablet cannot boot into normal mode, it automatically enters Fastboot Mode.
  3. Unsuccessful firmware via .
  4. Manual removal executable file from system directory after root unlock access.
  5. Exposure to malware. If you have superuser rights on the device, some viruses can be blocked or even removed system files, which leads to a crash of the operating system.

Having figured out what the Fastboot Mode bootloader is and what are the reasons for its appearance, you can begin to consider the question of how to exit boot mode on Xiaomi, Meizu, Lenovo and other models of mobile devices.

Disabling Fastboot Mode on Android

There are two ways to disable the Fastboot bootloader:

  • directly from your phone;
  • via PC.

The choice of one option or another depends on the reason that led to the launch this mode. As an example, let's look at how to prevent the Fastboot window from loading on a Xiaomi smartphone.

Faced with this problem, first of all, try holding down the Power key for 20-30 seconds. The device should reboot in standard mode.

Instead of Fastboot, the Select Boot Mode form may appear on the mobile phone screen. Its fields mean the following:

Try choosing the second option. If this does not help, do the following:


If you can go to Xiaomi settings, that is, the OS is working, try to disable the Fastboot mode manually. On this device, go to the " Special abilities» and opposite the corresponding item, drag the slider to the Off position.

Disabling Fastboot Mode via Computer

If the operating system crashes, when it is technically impossible to use the smartphone menu, and other methods of disabling Fastboot are ineffective, you can try to solve the problem through a PC and command cmd line. This is done as follows:


The command line is the most in a valid way getting rid of Fastboot Mode. If this does not solve the problem, then there is the question of how to turn on the mobile device in normal mode, is still relevant, all you have to do is change the firmware on your phone or take it to a workshop.

Many of us are already familiar with ADB (Android Debug Bridge) because, being the owner Android devices, quite often you have to perform such simple steps, How adb push And pull, or adb reboot etc. But for many novice users, just the sight of the command line is already scary, and it seems prohibitively possible. Although in fact everything is quite simple, experienced users will not let me lie, and the biggest difficulty is to remember all these commands, although this is not necessary to do either, since the Internet is always at hand and can be found the right command is not difficult.

Android Debug Bridge, which is part of Android emulator SDK allows you to communicate between your computer and an Android device connected to it. By the way, if you need some software, you can download the programs for your laptop for free here. What can I do with ADB? Its capabilities are quite wide, for example, the most popular actions: copy files from an Android device to a computer, upload files from a computer to Android, perform many Linux commands, receive error reports, etc.

So if you're new to this and want to learn a little more about ADB than just what it is, then I suggest you check out my little basic guide to learning ADB.

What you will need

1. Android Debug Bridge (ADB) for Windows 32bit - download

2. Android Debug Bridge (ADB) for Windows 64bit - download

3. Computer with installed Windows OS.

Now let's move on to the active phase:

1. Download the required zip archive and extract it wherever you want, for example, drive C.

2. Now go to the directory C:/adb/sdk/platform-tools. Here you will find a set of files as shown in the image below.

3. Hold down the Shift button + right-click and launch the Windows command line from the current directory.

4. Enter the command adb start-server.

5. To make sure that your device is connected correctly and has been recognized by the computer, enter the command: adb devices. If all is well, you will see something similar to this:

Now that your device is connected and everything is working, let's play with it a little.

Reading LOGCAT via ADB

The easiest way is to run the command: adb logcat. As a result, the entire contents of the device log file will appear on the screen. To get logcat to separate file do: adb logcat > logcat.txt.

BUGREPORT

You can run the command: adb bugreport, but you will receive a notification that the generated report will not be readable, so it is better to use: adb bugreport >result.txt.

ADB together with ROOT access rights

To work from under ADB with full rights access, you need to root the device. If the device is already manual, then run the command: adb root and we see what is shown in the picture below (reboot ADB with root rights ami).

Installing applications via ADB

To install the application, make sure that in the title apk file but there were no spaces and you need to know exactly the correct path to it. Well, then we run the command: adb install+ name of the installation file. In my example, I installed the papertoss game, so if everything goes well, you will get this picture on the screen:

Many of you have more than once encountered a situation where getting root rights to Android tablet or smartphone, installation new firmware, system recovery and other things, you had to connect it to the computer and run a series of commands adb or fastboot, through the command line (terminal) window.

Most people enter these commands without understanding what they mean, simply following instructions found on the Internet. And if you want to get a more complete understanding of what happens when they are executed, then today we will get acquainted with a dozen basic commands that every advanced Android user should know.
But before you start getting acquainted with these commands, let me remind you that before your tablet or smartphone can execute them, you must make sure that your computer has Android SDK, and on the tablet or smartphone itself, the option “ USB Debugging».

How to install the Android SDK, which contains the adb and fastboot programs, read. Let me also remind you that in Android 4.2 and higher, the “USB Debugging” item is hidden, and you can read how to access it.

For those who have forgotten how to launch a command line window in Windows, let me remind you that the easiest way to do this is by clicking on “Start”, after which you will need to type cmd in the search window and press the “Enter” key.

After everything preparatory work finished, you can connect the device to your computer using USB cable and start learning the commands.

1 adb devices command

This is probably the most important of all ten teams that will be discussed. Using it, we can find out whether the computer sees your Android device, and if it does, then whether it can communicate with it through terminal commands.

If everything is fine, then after entering the adb devices command in a Windows command line window or Linux terminal, you should see a line with the text List of devices attached, after which there will be a line consisting of the serial number of your device and its status - offline or online:

The offline state means that the device is in sleep mode. The online state signals that the tablet or smartphone is ready to carry out your commands.

2 adb push command

Using the adb push command, you can copy files to your tablet or smartphone. In this case, you must specify the path to the folder where you want to place the file on the device and the folder on the computer from where the file will be copied. The second path is not necessary if the file is located in the same folder where the adb program is located.
Here is an example of copying a video file superfreak.mp4 from a computer to a device, to the /sdcard/Movies folder using the adb push superfreak.mp4 /sdcard/Movies/ command

For Windows users I would like to remind you that in Android, when specifying the path to files and folders, a forward slash - / is used, and not a backslash, as you are used to.

3 adb pull command

If the adb push command is used to transfer files to an Android device, then adb pull is used to copy files from the device to the computer. Just as in the previous case, you must indicate the path where you want to get the file on the device and the path where you want to place this file on the computer. The second path is not necessary if you want the file to go to the folder from which you ran the adb program.

Here is an example of copying the superfreak.mp4 file from the /sdcard/Movies/ folder of your tablet or smartphone to your desktop Windows table 8 user Jerry, C:\Users\Jerry\Desktop

Learning Android. Ten basic ADB and fastboot commands you should know
If you want the file to go to the folder you ran adb from, just enter adb command pull /sdcard/Movies/superfreak.mp4

4 adb reboot command

This command is often used during the process of rooting or installing new software, when we need to accept the changes that we have made on our device. After you enter the adb reboot command, your tablet or phone will reboot.

This command is also important because it can be placed inside scripts, which allows you to reboot the device automatically after completing all the necessary operations.

5 Commands adb reboot-bootloader and adb reboot recovery

WITH using adb You can not only reboot your Android device, but also reboot it into the bootloader. This mode is needed so that we can unlock the bootloader, which is necessary to obtain root rights and further install alternative firmware.

Some devices can be bootloaded using certain combination keys when they are turned on, but often the adb reboot-bootloader command is the only way access the bootloader.

Similarly, the adb program can be used to access the recovery menu of a tablet or smartphone or recovery. This can be done using the adb reboot recovery command

6 Fastboot devices command

If you rebooted your tablet into bootloader mode, it will stop accepting adb commands. In this mode, we can communicate with the device using the fastboot program.

Using the command fastboot devices you can find out if your device can accept commands from this program in bootloader mode. Since fastboot is very powerful tool, some Android device manufacturers do not provide access to this program in bootloader mode.

Just like with adb, after entering the fastboot devices command you should see serial number your device.

Often the reason fastboot does not work is the lack of necessary Windows drivers your device.

7 Fastboot oem unlock command

Some manufacturers (for example, HTC or Asus) produce special utilities, allowing you to unlock the bootloader of their tablets and smartphones, after which they can install alternative recovery, such as ClockworkMod or TWRP and firmware from independent developers (custom firmware).

However, in many cases, unlock Android bootloader devices using the fastboot program. This is very easy to do - when your tablet or phone is in bootloader mode (step 5), just enter in the command line window next command: fastboot oem unlock.

After this, you will need to follow the instructions that will be displayed on the screen of your tablet or smartphone.

Attention! After executing the fastboot oem unlock command, your device will be completely cleared of any programs you have installed and your personal data will also be deleted.

8 adb shell command

Team adb shell often confuses some novice users.

There are two ways to use this command. If you simply type adb shell in the command line window and press the Enter key, you will be taken to terminal mode, or the command shell of your Android device, where you can perform any Android commands shell.

Below you can see the result of running the ls command in the environment Android shell

This mode is well known Linux users And Mac computers. If you are familiar with bash shell commands, you will have no problems working in this mode. Otherwise, I do not recommend using adb shell mode until you understand the purpose of all its commands, since in this mode you have full access to files on your device and may accidentally cause irreparable changes to the operating system.

The second way to use adb shell is to execute a single Android shell command using this construct: adb shell<команда>. For example, you can change file permissions using a command like “adb shell chmod 666 /data/filename”

9 adb install command

With the adb program, you can do more than just copy files to and from your device. This program also allows you to install applications on Android devices in the form of apk files. There is an adb install command for this. It's a bit like the push command: you have to specify the path where the file with the application you want to install is located. Therefore, the easiest way is to first copy the apk file to the folder with the adb program, after which you can install the program using the command adb install ApplicationFileName.apk

If you need to update the application, then in this case you need to use the -r switch and the command will look like this: adb install -r ApplicationFileName.apk.

Using the -s switch you can install applications on the memory card (if your firmware allows this). The -l switch allows you to lock the application during installation (by installing it in the /data/app-private folder). There are other keys for more advanced functions, but their description is the topic of a separate article.

10 adb uninstall command

Lastly, you can remove apps from your tablet or phone. To do this, use the command adb uninstall ApplicationFileName.apk
This command has the -k switch, which allows you, when deleting an application, not to delete its data and cache, but to leave them on the device.







2024 gtavrl.ru.