What is usb android debugging. What is USB Debugging Mode on Android? Rollback to backups

Every user of a modern Android device at some point faces discomfort when he needs to activate functions that are not available during normal operation. One such feature is USB debugging.

Instructions

To carry out the procedure, we will need a smartphone running Android and a USB cable. Most often, Android USB debugging is used to obtain special root rights for the device. Moreover, the first procedure is not particularly complicated, it is accessible to the average user, and all actions are thought out by the manufacturer in advance.

Let's take a closer look at how to enable USB debugging on devices running the Android platform. Let's start by calling the main menu of your device. This stage should not be a source of particular difficulties for the user. Next, we carefully look through the list of items in the main menu. Find “Settings”. We enter this section, now we need to find the “Applications” link and expand the “Development” node. The first tab at the top, visible on the screen, is called “USB Debugging”.

If under the selected item there is a comment about enabling debugging mode when connecting to a computer via USB, then we are doing everything correctly. All we have to do is put a tick on the right side of the inscription that was indicated above.

It should be remembered that all actions that can be performed by an inexperienced device owner in modes not intended for ordinary users may well cause irreparable damage to the device.

Check how correctly you are trying to solve the problem with specialized sources.

USB debugging mode for tablet computer

If you need to carry out the procedure on a tablet device, we need to go to the device settings. Go to the appropriate item using the clock, which is located in the lower right side of the screen.

We click on them, after which a special menu opens in front of us, in which we should find the control icon for our mobile device. It is at this point that the desired settings are located.

What if there is no such item?

In some cases, the “For Developers” item may simply not be in the menu. Note that Google has an excellent one. So, go to “Settings”, then “System”, select the “About tablet” item, after which you need to click on the “Build number” item about ten times.

This may seem strange, since the item cannot be opened immediately, but the developers chose this method.

By the seventh or tenth click, the system will agree that you will become a developer for a while. If this happens in the “System” section, in the device settings menu, a “For Developers” link will appear. That's all. Next, follow the instructions described above.

Why is USB debugging needed?

Let's summarize. Let's start with the fact that many fans of the “green robot” simply do not know about all the possibilities that such a tablet or smartphone hides. Often, Android device owners do not use even ten percent of the potential of their modern gadgets. USB debugging mode allows you to use interesting features of the Android operating system.

First of all, USB debugging is necessary for software developers. In some cases, ordinary users can also find many interesting solutions for themselves.

Using this mode, when using the ADB utility, which is part of the Android SDK platform, you can obtain special superuser rights; easily copy the desired file or folder from your smartphone to your personal computer; restore the functionality of your tablet or smartphone; flash the gadget; create a backup copy of all applications; install the Android application; send the required file from your personal computer to your smartphone.

As for the rights of the so-called superuser, they are quite easy to obtain. A specialized Unlock Root program will help you. This solution is supported by devices based on Android 2.1 - 4.0.3. Download and install the specified application. Follow the instructions. If during installation strange symbols are displayed instead of the usual letters, do not pay attention - after completion everything will be correct in the program interface.

Most people use their tablet or phone in “as is” mode, not noticing various inconveniences in work or simply putting up with them. However, a fairly large category of users are trying to modify it to suit their needs or gain the opportunity to freely manipulate data and settings. Another category is service center workers. USB debugging is a method for those who want to get to know their tablet or phone better. Make adjustments, changes, diagnose problems, and so on.

Everyone is a little familiar with the principle of constructing an operating system. It should be clear to you that you need to look for the answer to the question of how to enable USB debugging in the “Settings” item of the main menu. However, the location and method of inclusion are very different. This, as well as the choice of the device manufacturer. Let's look at ways to enable USB debugging mode.

Standard option

In firmware where the manufacturer has not tried to complicate access to rooting and flashing capabilities, as well as on devices without the ability to fine-tune diagnostics, Android USB debugging is enabled. In the “Settings” item of the main menu there is a “Development” section, in which you need to check the box next to the “USB Debugging” item.

Other firmware version

The location looks similar for firmware with a “close” version. For example, this may be the same “Settings” item, but then the submenu will be called “For Developers”, where you also need to check the debugging option.

Operating system versions 2.2 - 3.0

There is a more detailed menu here, the development item is located at “Settings” - “Applications”. Next, USB Android debugging mode is enabled in the same way as described above.

Other firmware

There may be an option when the “Applications” submenu in the “Settings” menu is called “More”. The rest is the same as point 3.

Operating system versions 4.2 and later

Here, the Android USB debugging option is deliberately hidden. For the activation checkbox to become available, you need to go to , select “About tablet” and click on “Build number” about 10 times. After this, the “For Developers” sub-item will appear in the “Settings” menu, where the “USB Debugging” option will become available.


Other location

The “About Tablet” item can be located directly in the “Settings” menu. However, there are versions of operating system builds when you need to additionally go to the “System” or “General” submenu. Otherwise, debugging is as in point 5.

PC connection

Before you can use a USB debugging application or a root utility, you must connect your device to your computer correctly. The first thing that can create an obstacle on this path is the lack of drivers. However, this problem can be solved. For branded devices with non-standard exchange protocols, everything you need can be found on the official websites. In addition, phone book, picture, and music programs from device manufacturers are usually supplied with driver sets. It is enough to install the appropriate utility.

As a good option, we can recommend the MOBILedit Enterprise program, which offers a huge selection of drivers for all types of equipment.

or smartphones from Chinese manufacturers based on MTK processors. If you still cannot install the drivers, you should look for them on specialized sites based on the device model and operating system firmware version.

When the drivers are installed, the first connection to the PC will require confirmation of trust. After checking the appropriate box in the request on the tablet, data exchange will be allowed.

Why is debugging needed?

  • Let's briefly list some of the tasks that can be solved using USB debugging:
  • , and sections responsible for operating system settings;
  • easy file transfer, bypassing built-in transcoding systems;
  • restoration of work after incorrect installation of applications;
  • changing the operating system version to a newer one;
  • changing the firmware to gain access to individual device functions or a language pack;

obtaining root (root) rights.

Video on how to enable USB debugging on Android:

The last point is worth dwelling on in more detail, since rooting is the reason for enabling USB debugging in approximately 99% of cases.

Why root your tablet or smartphone?


Root access is, roughly speaking, maximum rights in the operating system. They allow you to backup all contacts, message contents, phone history, and information.

The operating system is built in such a way that it has an AfterStart event. It can contain a whole list of actions, including launching other processes. Often this is displaying advertising, collecting statistics and other frankly “unnecessary” things. With the help of root rights and small applications, you can flexibly manage the operation of both Android as a whole and individual programs.

In the Android settings, you probably found the mysterious “USB Debugging” item, but does everyone know what this mode is for and how to enable it correctly on different versions of Android OS?

Why is debugging needed?

Initially, this mode was provided exclusively for developers of applications or services for Android. Using debugging, they gained access to the “insides” of the operating system.

But subsequently, more and more cases began to occur when “ordinary” users also needed the debugging mode. It’s just that the developers created automated tools for obtaining root (), restoring a smartphone, modifying the OS, which required a debugging mode.

Despite the menacing name, activating this mode is quite simple.

How to enable debugging

For Android 4.1 and earlier: When the developer menu is visible:

In earlier versions of Android, developer options are available explicitly and openly. Just open system settings. In different versions, the developer options section may be located in different places: in the general list, in the “Applications” section, in the main menu.

Select “USB Debugging” and check the box there. You will see a warning pop-up; just click "OK".

There is no need to reboot your smartphone to activate this mode.

What to do if the required section is not visible?

In Android versions starting from 4.2.2, debug mode (as well as other developer options) is not shown in the menu. However, there is a way to open them easily:

  • Open the settings menu and the "General" tab
  • Find the "About device" section
  • Open the “Software Information” item in it.
  • Find the line “Build number” in it and tap on it 7 times
  • After the notification about receiving developer status appears, return to the “General” section
  • Find the “Developer Options” item that appears.
  • Find the line “USB Debugging” in this section and check the box there
  • Exit menu

Congratulations, you can now access your device via your computer!

Cases when debugging saves

Any Android user has situations when debugging is desperately needed. It’s good that you used the instructions from the previous section and activated it. Now you can:

  • Get root access on your smartphone/tablet using special applications for your computer. Debugging enabled is required for this.
  • Retrieve data from a device whose display is not working. We devoted a separate article to this problem.
  • Restore your device if it won't boot. To do this, you need to use special utilities, which may differ for different devices and chipsets. Look for more detailed information specifically about your model.
  • Work with the command line on your computer to quickly copy files, install an application or a whole set of applications at once, change access rights to a particular file. To do this, the ADB (Android Debug Bridge) program must be installed on your computer, which allows you to issue commands to the Android environment on the connected device. It has both a graphical interface and a set of console commands that are issued via the command line.

Overall, if you want to get the most out of the functionality of your Android tablet or smartphone, the debug mode will be extremely useful to you.

We have already described in the article how to enable the developer menu and USB debugging on an Android phone or tablet in the traditional way.

This article will talk about enabling USB debugging on an Android device with a broken screen, which may be necessary in order to.

1. Warning

This method requires programming/system administration skills for Windows and Linux operating systems, or at least great care, since making mistakes when typing the commands below can lead to complete inoperability of the phone/tablet.

This instruction is primarily suitable for devices running Android 4.0 (Ice Cream Sandwich), Android 4.2 (Jelly Bean), Android 4.4 (Kit Kat), and Android 6.0 (Marshmallow), since it was tested on them. Other versions of Android may have changes to system files, so even executing the following commands exactly may not produce the desired result. In this case, roll back to the backups, as described in the last section “5. Rollback to backups” of this article.

2. The principle of enabling USB debugging via a computer

The idea of ​​enabling USB debugging via a computer is to directly edit system files via the ADB (Android Debug Bridge) interface via custom recovery (CVM/TWRP) before loading the Android system directly, which means that you first need to install a custom recovery and ROOT on your phone. rights. It should be noted that on some Chinese phones (for example, UMI, iconBIT) ROOT is already installed by the manufacturer and the commands listed below will work even with native (factory) recovery.

3. Preparation

3.1. Installing custom recovery

Unfortunately, there is no universal way to install custom recovery and ROOT rights suitable for any Android device. You need to look for instructions specifically for your device, but there is good news: you can install custom recovery on your phone/tablet with virtually no involvement of its screen (No-Touch recovery version) using the fastboot device bootloader (the bootloader must be unlocked). Therefore, google installing custom recovery on your specific device with the keywords:<модель Вашего телефона/планшета>, No-Touch CVM/TWRP, ROOT, recovery, fastboot, bootloader, flash tool, etc.

An article about . may be useful as a guide. True, for example, to install TWRP and ROOT on Xiaomi phones, where you first need to do this and you have not previously registered for this and have not logged into the MI account on the device, it is unlikely that you will be able to unlock the bootloader without a screen. Therefore, we recommend not to waste time, but to immediately take such a phone to a service center to replace the screen.

3.2. Preparing your computer

In this guide, we will tell you how to enable USB debugging using a computer running Windows 10. The necessary software can also be found for other operating systems. The commands listed below are also valid for other operating systems (MacOS and Linux), but their syntax must be modified to match the syntax of the command interpreters on those operating systems.

3.2.1. Installing Android SDK Tools

3.2.2. Installing Notepad++

Typically, Android system configuration files are plain text files. Although they can be opened and edited with the built-in Notepad in Windows, we recommend using the free code editor for Windows - Notepad++, as it automatically recognizes line breaks in the file. You can also turn on the display of control characters (View > Symbol Display > Show All Symbols).

3.2.3. Installing SQLite3 (for Android 4.0, 4.2, 4.4)

If Android 4.0, 4.2 or 4.4 is installed on your phone/tablet, you will also need to edit the database with the device settings. To do this, we will use the console database editor for Windows - SQLite3, which can be downloaded from the official website.

3.2.4. Creating a working folder on your computer

Create a folder "android-config" in the root of drive C, unpack the archive with SQLite3 into this folder (for Android 4.0, 4.2 or 4.4). Also create a “backup” folder in the “android-config” folder to store all backup copies of the Android device system files that we will edit.

3.3. Booting into custom recovery

Reboot your Android device into custom recovery. This also depends on the device, but usually with the phone/tablet turned off, you need to press and hold the volume down or up and power keys together for a few seconds. A variation is also possible with holding down both buttons (volume up and down) and turning on the phone/tablet. Even less common, but there is a method where you only hold down the volume keys and connect the charger to a switched off device. In general, check the key combination for your device on Google.

4. Actually enabling USB debugging from the computer

Open the "platform-tools" folder, hold down the "Shift" key, right-click in an empty area of ​​the Windows Explorer window and select the "Open command window" context menu item.

Connect your phone/tablet to your computer, type the following command in the command line window:

adb devices

and press the "Enter" key.

If the device ID is displayed and the word “device” or “recovery” next to it, then you have successfully connected to your phone/tablet using ADB.

4.1. Deleting presets

Run the following commands to remove the preset parameters (if errors occur as a result of execution, it’s okay, it means these parameters are no longer in the system):

(First, make backup copies of the deleted system settings files) adb pull /data/property/persist.service.adb.enable c:\android-config\backup adb pull /data/property/persist.sys.usb.config c:\android -config\backup (Call the interactive command shell) adb shell (Delete system settings files on the device) rm /data/property/persist.service.adb.enable rm /data/property/persist.sys.usb.config (Exit the interactive shell) exit

4.2. Editing the main configuration file

(Making a backup copy of the main configuration file) adb pull /system/build.prop c:\android-config\backup (Making a working copy of the main configuration file. To avoid typing everything again, press the "Up" key and edit the command.) adb pull /system/build.prop c:\android-config

Open the file “c:\android-config\build.prop” in the Notepad++ editor and look for the following parameters in it:

Persist.service.adb.enable=1 persist.service.debuggable=1 persist.sys.usb.config=mass_storage,adb

If the parameters exist, but their properties are different, edit them in accordance with the values ​​above; if such parameters are missing at all, add them to the end of the file. If your device was previously detected by the computer not as a flash drive, but as a media device, the last option should be:

Persist.sys.usb.config=mtp,adb

Save the file and run the command:

(Upload the edited configuration file back to the Android device) adb push c:\android-config\build.prop /system

If you receive a copy error “adb: error: failed to copy ‘c:\android-config\build.prop’ to ‘/system/build.prop’: remote Read-only file system” run the command:

(Mount the "/system" partition in read-write mode) adb shell "mount -o rw,remount,rw /system"

(Assign the owner/group "root" to the file "build.prop") adb shell "chown root.root /system/build.prop" (Set access rights to "644" for the file "build.prop") adb shell "chmod 644 / system/build.prop"

4.3. Editing the database (for Android 4.0, 4.2, 4.4)

Next step: You need to edit the Android settings database (for Android 4.0, 4.2, 4.4). Download the database to your computer:

(Making a backup copy of the database with settings) adb pull /data/data/com.android.providers.settings/databases/settings.db c:\android-config\backup (Making a working copy of the database with settings) adb pull /data /data/com.android.providers.settings/databases/settings.db c:\android-config

Open the folder "c:\android-config" with a working copy of the database and launch a new command line window there (see above), but do not close the previous one! We are interested in the "adb_enabled" and "development_settings_enabled" settings. They can be in the "secure" or "global" table. We run the following SQL queries to find our settings:

(Connect to the database) sqlite3 settings.db (Check the "secure" table for the "adb_enabled" option) select * from secure where name="adb_enabled"; (Check the "secure" table for the presence of the "development_settings_enabled" option) select * from secure where name="development_settings_enabled"; (Check the "global" table for the presence of the "adb_enabled" option) select * from global where name="adb_enabled"; (Check the "global" table for the presence of the "development_settings_enabled" option) select * from global where name="development_settings_enabled";

In our case, the required options were found in the "global" table and their values ​​are "0".

We need to assign them new values ​​- "1".

(Updating the value of the "adb_enabled" option) update global set value="1" where name="adb_enabled"; (Updating the value of the "development_settings_enabled" option) update global set value="1" where name="development_settings_enabled"; (Disconnect from the database) .quit

Go to the previous command line window and execute the commands:

(Upload the edited database with settings back to the device) adb push c:\android-config\settings.db /data/data/com.android.providers.settings/databases (Assign the owner/group "system" to the file "settings.db" ") adb shell "chown system.system /data/data/com.android.providers.settings/databases/settings.db" (Set access rights to "644" for the file "settings.db") adb shell "chmod 644 /data /data/com.android.providers.settings/databases/settings.db"

4.4. Checking whether USB debugging is enabled

(Reboot the Android device) adb reboot

When the device boots up, run the command:

adb devices

If "offline" is displayed instead of "device" or "recovery", run the command:

Adb kill-server adb devices

If nothing has changed, most likely there is no public access key on the phone. For the same reason, "adb devices" may show "unauthorized". Go to the ".android" folder located in the home directory of your Windows account, copy the "adbkey.pub" file to the "platform-tools" directory and run the command:

Adb push adbkey.pub /data/misc/adb/adb_keys

Repeat the "adb devices" command to ensure that the connection is configured.

All! If you have successfully reached this point, congratulations! Now you can run on your computer or other similar software to control the screen of your Android device.

5. Rollback to backups

If nothing works, and these instructions did not help, return the previously saved backup copies of system configuration files back to the Android device. To do this, reboot the device into custom recovery and return the original files. For example, for the main configuration file "build.prop" the commands would be:

(Upload a backup copy of the "build.prop" configuration file to the Android device) adb push c:\android-config\backup\build.prop /system (Assign owner/group "root" to the "build.prop" file) adb shell " chown root.root /system/build.prop" (Set access rights to "644" for the file "build.prop") adb shell "chmod 644 /system/build.prop"

For other files, the actions are similar, only we upload them to the appropriate directories on the Android device and set the appropriate owners/groups and rights:

  • settings.db (system.system, 644)
  • persist.service.adb.enable(root.root, 600)
  • persist.sys.usb.config (root.root, 600)

Many instructions when working with a device on the Android platform require you to enable USB debugging mode. This option is available in all gadgets of this operating system, but its location may differ depending on the version of Android. Let's figure out how to enable or disable USB debugging mode.

Why do you need USB debugging mode?

USB debugging mode allows you to use the Android Debug Bridge (ADB) service, which checks the operation of each application and the system as a whole. This mode is mainly actively used by developers when creating new applications or improving old ones. But it can also be useful for ordinary users. What else can you do with this service:

  • copy the desired folder or section from your smartphone to your PC;
  • send a file from PC to smartphone;
  • install the Android application;
  • make a backup copy of applications;
  • flash a smartphone;
  • restore the functionality of your smartphone or tablet;
  • get Root rights.

How to enable USB debugging mode: step-by-step instructions

There are several ways to enable USB debugging on your device. Several options will be presented below, they are distributed according to Android versions, but there are also exceptions to the rules. For example, the last method works on Sony Xperia M with operating system version 4.1. Therefore, if you were unable to enable debugging using standard methods, use the options for other versions.

For Android versions 2.2 – 3.0

  1. Go to the Settings menu.
  2. Find the “Applications” item there.
  3. Among all applications, find “Development”.

Android less than 4.2 - first method

  1. Go to Settings menu
  2. Find the “Development” or “For Developers” item there.
  3. Check the “USB Debugging” checkbox.

Android less than 4.2 - option two

  1. Go to the Settings menu.
  2. Open the "More" item.
  3. Find Developer Options.
  4. Check the “USB Debugging” checkbox.

Connecting debugging for Android versions 4.2 and higher

  1. Go to the Settings menu.
  2. Find the "System" item. In Xiaomi, Samsung and LG phones, this menu item may be called “General”. If you don’t find anything similar in yourself, move on to the next step - in your case, the operation will require one less step.
  3. Next, click on “About smartphone/tablet/phone”.
  4. Find “Build number” and click on it 7-10 times (depending on the phone model, but sometimes there is a hint on how many times you need to click). Now you are a developer and can use more advanced functionality of the phone.
  5. Return to the Settings menu.
  6. Now you have the item “For Developers” or “Features for Developers”, click on it.
  7. Check the box next to “USB Debugging”.

Video: Activating USB Debugging

Authorizing the computer after enabling debugging mode

This item is relevant for versions of Android 4.2 and higher. After enabling USB debugging mode, you will, of course, need to connect your smartphone or tablet to your computer. The device will identify this computer and ask for permission to debug from this PC. In order for debug mode to work as intended, you will need to enable debugging on your phone. If you want to prevent such a request from appearing when you connect to this computer in the future, check the box next to “Always allow this computer.” But when connecting to any new device, the smartphone will still ask for permission.

The device was not detected - why did this happen and what should I do?

Driver shortage

When you first connect your smartphone or tablet to your computer, the first thing the PC does is search for and install drivers for your device. Most often, this is some kind of program that has the name of the manufacturer of your gadget in its name. Look for something similar among all installed programs on your PC. If such a program was not found, then use the Internet to search and install the drivers yourself.

Device locked state

Make sure your smartphone or tablet is turned on. Unlock the device, if required, enter a picture or regular password.

USB port

Do not use USB 3.0, only USB 2.0 is suitable for debugging.

PTP mode

If you still cannot activate the debugging mode, try, while connecting to the PC, lower the top information panel on your smartphone or tablet down and select “USB Connection”. After this, change the connection mode to PTP.

How to disable USB debugging mode

If you have already found an option to enable this mode that suits you, then turning it off will not be a problem. Follow the same list of instructions as for enabling debugging mode, but instead of checking the USB Debugging checkbox, uncheck it.

USB debugging mode is primarily needed by developers, but can also be useful for ordinary users. There are several methods for turning it on; the choice of method depends only on the version of Android and, possibly, on the gadget manufacturer. When connected to a PC, the device may not be detected by the computer, but this problem can also be easily solved by correctly enabling the settings.