What is USB debugging. Application for USB debugging on a tablet

No matter how advanced a smartphone is, it is still a dependent device. In many cases, to work with mobile device still needed Personal Computer. In particular, when it comes to mobile development or restoring the device after unsuccessful firmware. For example, if the gadget fails, to reinstall the system you will need a cable (via USB) connection from the smartphone to the PC. In order for the computer to detect your phone or tablet, the device is put into debugging mode. In this article we will try to tell you how to enable USB debugging on Android and what else it might be needed for.

What is USB debugging - why is it needed?

If you don't hit technical features, then debug mode (this mode is also called debug mode) is a feature of Android gadgets created for testing new software products. Developers use it to evaluate the performance of their applications.

USB debugging allows you to perform the following tasks:

  1. Testing and verifying applications before releasing them to the Play Market.
  2. Obtaining ROOT rights (hacking) of a mobile device.
  3. Copying files from the root directory of the operating system.
  4. Installing software from third party sources.
  5. Installation unofficial firmware Android.
  6. Creating backup copies of devices (data archiving).

Debugging mode can be used to restore the firmware if, for example, it does not work correctly or the phone stops turning on.

How to enable USB debugging mode on Android

Enabling USB debugging from a phone or tablet is done through the settings menu. This option is usually found in the developer options or accessibility menu.

Often this menu item is hidden so that ordinary users cannot switch to debugging mode and do not disrupt the operation of the system. Usually, famous manufacturers like Samsung or HTC resort to this, while Chinese manufacturers allow you to enable USB debugging mode on your smartphone without any questions asked.

If you own a device from Samsung or any other major brand that hides debugging access, then you will have to do the following:

  • Open system settings.
  • Go to the “About phone” submenu.
  • Click on the system build number until the device switches you to developer status.
  • In the new status, you can again try to go to the section with options for developers and enable USB debugging.

Enable USB debugging via computer

This method will be useful for those users whose devices for some reason do not have a touchscreen, the screen is broken, or there is no way to connect a USB mouse.

Often, to switch to debugging mode, you need to connect your smartphone or tablet to your computer. To do this, you will have to use a number of additional tools and be patient.

So, to go to this mode via a computer you need to do the following (this method is suitable for all versions of Android, including 5.0, 6.0, 7.0 and higher):

  • First, you need to download the Platform-Tools and QtADB-CWM files (these are Recovery files for restoring devices).
  • We move these files to the root directory of the computer on drive C.
  • Download the Sqlite3 archive and move it to the Sqlite3_Windows directory on drive C (you need to create it yourself).
  • We put the gadget into recovery mode and connect it to the computer.
  • Run the previously downloaded QtADB.exe file.
  • After opening the program, find the Advanced sub-item there and make sure that the data folder is connected to the computer. The command line in the application will respond with Ready.
  • Then open the “Files” submenu. It is divided into two separate file manager. In the left FM we open the Sqlite3_Windows directory, which was created before, and in the right FM we open the /data/data/com.andoid.providers.settings/databases directory in Android.
  • Find the settings.db file in the right FM and drag it to the left.
  • Then open the Start menu, select Run and enter cmd there.
  • The Windows Command Prompt will launch.
  • You need to enter the following commands one by one:

cd C:\Sqlite3_Windows (to activate the command, press “Enter”)

sqlite3 settings.db (to activate the command, press “Enter”)

update secure set value=1 where name=‘adb_enabled’ (to activate the command, press “Enter”)

Quit (to activate the command, press “Enter”)

  • Go back to the QtADB application and update the data in the left panel.
  • After the update, drag the settings.db file back to the right side, where it was previously.
  • The program will ask if you need to replace the existing file - we agree.
  • That's all. The phone can be used in debugging mode.

What should I do if, after enabling USB debugging, the device is still not detected?

Unfortunately, USB debugging does not always work. Often, even after switching to this mode, the device does not function properly in it. Why might this happen and what measures should be taken to solve the problem?

  • Make sure you have the correct Android Debug Bridge driver installed. It can be found on Google's Android operating system website. For different devices Different sets of drivers are available. If there is no specific driver for your device, then you can use a universal one.
  • Make sure your device is recognized by your computer. If the cable or port is damaged, then the device may not be displayed in the system at all, and, naturally, there can be no talk of any debugging mode in this case.
  • USB debugging may not work properly on devices running unofficial firmware.

Conclusion

That's all, actually. Now you know how to enable USB debugging mode on Android. As you can see, if you strictly follow the instructions, then performing this procedure is not so difficult. The main thing is not to get lost and download all the necessary files in advance. In most cases, the methods described above are only needed by developers and testers, but there are situations in which ordinary users you have to work with this mode, so it’s better to familiarize yourself with how to enable it.

Where in Xiaomi Redmi 3s is USB debugging and what is it?

Answer

USB debugging mode is usually required for getting root access (superuser rights) or modification and modification of firmware, in other words, making changes to the OS at a deeper level. This mode was originally created for developers; it allows you to:

  • Optimize applications and the operating system itself
  • Check how the created program functions with the OS
  • Detect operational failures
  • Test hardware components
  • Update software
  • Create backup copy
  • Access file system smartphone from computer
  • Restore your phone
  • Receive detailed process statistics

The debugging service itself is called ADB (Android Debug Bridge). You can enable debugging mode on all Xiaomi devices through the phone/tablet settings. Depending on the version of your system, the location of the menu item you need may vary slightly.

  1. Go to the following path: Settings-General-About smartphone
  2. Find the line with the build number (miui version), then click on it about 7 - 10 times
  3. There should be a notification about enabling the menu for developers
  4. We return to the settings, go to “Advanced” and find the item “For Developers”
  5. In this menu we find the “USB Debugging” option and check the box next to it, that’s all.

It is worth mentioning that after connecting to the computer for the first time in debugging mode, you will need to confirm the connection on your phone.

If the smartphone is not detected, there are usually three reasons:

  • The device is locked - you just need to unlock the smartphone
  • Inappropriate usb port - use only rear ports and version 2.0
  • Drivers are missing - download MI PC Suite or find drivers separately

Information helped 1 The information didn't help 1

USB debugging allows you to use the service for debugging applications and devices on the Android OS: check how the application and system work, and what failures have occurred.

Enable USB Debugging

In all Android devices, USB debugging is located in Menu > Settings, but the location options may vary, for example:

Menu > Settings > Development > USB Debugging (On) Menu > Settings > Applications > Development > USB Debugging (On) Menu > Settings > More > Developer Options > USB Debugging Menu > Settings > General > About smartphone/About tablet > Build number (click on it 7 - 10 times), then return to Settings > For Developers > USB Debugging (on)

After enabling USB debugging

Unlock your smartphone or tablet. Do not use USB port 3.0, USB 2.0 only when connected to a computer.

When the device connects to the computer for the first time, you will be asked to trust the computer: check the box and click OK. USB debugging is enabled.

Installing a USB Debugging Application

For debugging, the ADB program (Android Debug Bridge) is used. ADB is an integral part Android SDK which you need.

Download zip archive with the Android SDK, it contains the adt-bundle-windows-x86_64-20140702 folder, which contains the SDK itself. Unpack it onto your computer. For example, we placed the folder in the root of drive C, i.e. the path to the SDK will be like this: C:\adt-bundle-windows-x86_64-20140702\

We make sure that the computer is connected to the Internet and launch the SDK Manager program located in the adt-bundle-windows-x86_64-20140702 folder.

If SDK Manager does not start, install Java SE.

After launching the SDK Manager program, the installation window will appear. We need to download and install

✓ Android SDK Platform-tools ✓ Android SDK Tools ✓ Google USB Driver package

We mark these three items on the list and uncheck all the others. Click “Install” and wait for the program to download the components.

USB drivers for 32 and 64 bit Windows will be downloaded to the folder C:\adt-bundle-windows-x86_64-20140702\extras\google\usb_driver (install them later if you do not find official drivers for your tablet or smartphone).

We connect our device to the computer - the computer will detect new equipment. We install drivers from the manufacturer’s website or from the folder where they were downloaded earlier (installation is done through the Task Manager> * Unknown device* > right mouse button > Update Driver Software.. > search for driver on PC > downloaded drivers).

After installing the drivers, a new “ADB Interface” device will appear in the device manager.

If the device is not identified in the manager as ADB Interface, check the drivers of your tablet or smartphone, turn off and on USB debugging mode, and reconnect the device to the PC.

Launching the ADB program

It is best to work with the ADB program through the command line Windows string. To call command line Click “Start”, and in the “Search programs and files” input field, type cmd and press “Enter”.

To see what devices are connected to the computer, type the command:

C:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe devices

The ADB program will display a list of devices currently connected to the computer. If the device appears on the command line, you can begin debugging.

Debugging i2 Control V2.2 via USB

Enter (1):

C:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe logcat

The command line will start displaying the log of your smartphone or tablet.

Stop logging by clicking Ctrl+C

Enter (2):

C:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe logcat >log.txt

Now the log, restarted using (1), will be saved to a text file located in C:\Users\*Username*\log.txt

Launch the i2 Control V2.2 application on your tablet or smartphone, run the log (1), perform the action whose log you want to save, stop logging by pressing Ctrl+C.

You can send the saved log to technical support, accompanying it with your project, description of the problem, model and firmware version of the tablet or smartphone on which the problem was detected.

How to enable the developer menu and USB debugging on your phone or Android tablet in the traditional way, we have already described in the article.

This article will talk about enabling USB debugging on an Android device with broken screen, which may be needed 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. In others Android versions Changes in system files are possible, so even the exact execution of the following commands may not lead to 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 behind enabling USB debugging via a computer is to edit directly system files via the ADB interface (Android Debug Bridge) via custom recovery (CVM/TWRP) before downloading directly Android systems, which means that you first need to install custom recovery and ROOT rights on your phone. 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: installing a custom recovery can be done on a phone/tablet with virtually no input from its screen (No-Touch recovery version) using the device's fastboot bootloader (bootloader must be unlocked). Therefore, google installing custom recovery on your specific device with keywords: <модель Вашего телефона/планшета>, No-Touch CVM/TWRP, ROOT, recovery, fastboot, bootloader, flash tool and so on.

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 complete and you have not previously registered for this and have not logged into your 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 manual we will tell you how to enable USB debugging using a computer running Windows control 10. Necessary software can be found for others 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++

As a rule, configuration system Android files are ordinary 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 your home directory account Windows, copy the file "adbkey.pub" 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 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)

Now I will teach you how to connect an Android phone via USB to a computer as a drive and thus enable data transfer and transfer information without using a flash drive. Very comfortably.

This article is suitable for all brands that produce phones on Android 10/9/8/7: Samsung, HTC, Lenovo, LG, Sony, ZTE, Huawei, Meizu, Fly, Alcatel, Xiaomi, Nokia and others. We are not responsible for your actions.

Attention! You can ask your question to a specialist at the end of the article.

What is MTP mode and where did USB mode go?

Before Android 4.4 KitKat, it was possible to connect via USB as a flash drive. The PC saw the device as removable drive and provided the same rights: the user could also perform other actions.

Then, in new versions of Android, the USB mode was replaced by MTP, in which only the data transfer function remained, and the same formatting did not work.

Setting up a phone connection to a PC via USB

To manage the connection to a computer via USB, you need. To do this, add to Android settings section “For Developers” (if it doesn’t exist):

  1. Open settings.
  2. Go to the "About phone" or "About device" section.
  3. "Build number" or "MIUI version".
  4. Press (click) on this item until you see a message that you have become a developer (usually 7-10 clicks are enough).
Increase

After the developer section appears in the settings, you can enable USB debugging. The item is called that way, so you just need to move the slider to the “On” position and confirm the resolution.


Increase

Now you can connect the device to your computer via USB and select the operating mode. IN latest versions Android most used are:

  • MTP - transfer any files from computer to phone and vice versa.
  • PTP - transfer of photos, as well as transfer of files not supported in MTP mode.
  • Charging only.

Connecting in USB storage mode

If you can't get used to using the media player, go back to using USB storage mode. For this you will need:

Using this method may damage system files. In this case, you will have to reflash Android.

So that Android connects to the computer as a drive.

Publications on the topic