> Attention!

New threads need to be created only inroot partition! In the future, they will be processed by moderators.



ADB | fastboot - their use | Work with auxiliary Android utilities



Rep: (6839)
ADB | fastboot - their use



Platform-tools:r30.0.5
ADB:1.0.41 (30.0.5-6877874)
Fastboot:30.0.5-6877874
Make_f2fs:1.14.0 (2020-08-24)
mke2fs:1.45.4 (23-Sep-2019)
Last update utilities in the header:06.11.2020


What is ADB?
ADB (Android Debug Bridge - Android Debug Bridge) is a tool that is installed with the Android-SDK and allows you to control a device based on the Android OS.
It works on all Android devices where this functionality was not intentionally blocked by the manufacturer.
Hereinafter: PC - PC, computer to which the device is connected.
ADB is a console application for PC, which is used to debug Android devices, including emulators.
Works on the principle of client-server. The first time you start ADB with any command, a server is created as a system service (daemon) that will listen on all commands sent to port 5037.
Official page
ADB allows you to:
  • See which devices are connected and can work with ADB.
  • View logs.
  • Copy files from / to the device.
  • Install / Remove applications.
  • Delete (clear) the data section.
  • Flash (rewrite) the data section.
  • Perform various management scripts.
  • Manage some network settings.
Supplied ADB as part of the Android Developer Toolkit (Android SDK), which, in turn, is part of Android Studio.


Installation
Unpack the archive (it is recommended to decompress the root disk or to another folder that does not contain Russian letters and spaces in the path). For example: C: \\ adb
Connection settings, device. Drivers.
Customize your phone.
To do this, go to: "Settings" - "About phone" - 7 times click on the build number. In the developer settings, enable USB debugging.
When you connect the USB-cable, select "File Transfer".
Check the connection on the computer.
Go in, early unpacked, the folder with the utilities. In it, in the address bar of a folder, the top write - "cmd" (without the quotes) and press Enter.
Check availability and device drivers are installed correctly. To do this, adb and fastboot command:
adb devices
fastboot devices
If everything is good, the drivers are successfully installed and the phone is properly connected - you will see the following answer:
<device serial number>device
or
<device serial number>fastboot

If something is wrong, then the List of devices attached will be empty.

Examples of installation on Linux:
ADB and all that can be done with it (Post Martifik # 28444786)
ADB and all that with it you can do (Post Aliana_Basil # 93244308)

Auto-installer for Windows
ADB and all that with it you can do (Post Aliana_Basil # 93708609)
How to use?
Since adb / fastboot - command line utilities, it is necessary to work with them from the command line.
Go in, early unpacked, the folder with the utilities. In it, in the address bar of a folder, the top write - "cmd" (without the quotes) and press Enter.
Further work by the teams that you require.
ADB commands
Solution: CreateFileW 'nul' failed: Can not find the file specified.

Hidden ADB commands
adb -dThe command is sent only to a device connected via USB.
Attention: will give an error if more than one device is connected.

adb -eThe command is sent to the device in the emulator.
Attention: You will get an error if more than one emulator is connected.

adb -s <serial_device_number>The command is sent to the device with the specified serial number:

adb -p <device name or path>The command is sent to the device with the specified name:
If the -p switch is not specified, the value of ANDROID_PRODUCT_OUT is used.

adb devices
List of all connected devices.

adb connect<host>[:<port>]
Connect to the android host via TCP / IP over port 5555 (by default, if not specified).

adb disconnect [<host>[:<port>]]
Disconnect from the android connected via TCP / IP port 5555 (by default, if not specified).
If no parameter is specified, disconnect from all active connections.

adb push<PC path><way to android>Copy file / folder PC->device

adb pull<way to android> [<PC path>]Copy file / folder device>PC

adb sync [<catalog>]
Copy PC->device only new files.
Keys:
-l Do not copy, only create a list.

adb shellRun a simplified unix shell.
Examples of using

adb emu<team>Send a command to the emulator console

adb install [-l] [-r] [-s]<application_name.apk>Send the app to your device and install it.
Example: adb install c: /adb/app/autostarts.apkInstall fileautostarts.apklying in a folder/ adb / app /on disk with:
Keys:
-l application lock
-r Reinstall application, saving data
-s Install the application on the memory card
Setting split apk

adb uninstall [-k]<application_name.apk>Remove application from device.
Keys:
-k Do not delete saved application and user data.

adb wait-for-deviceWait for the device to connect.

adb start-serverStart the service / daemon.

adb kill-serverStop the service / daemon.

adb get-stateGet status:
offlineSwitched off.
bootloaderIn boot mode.
deviceIn operation.

adb get serialnoGet the serial number.

adb status-windowContinuous polling status.

adb remountRemount for recording. Required for scripts that change data to.

adb reboot bootloader
Reboot to bootloader mode.

adb reboot recoveryReboot into recovery mode.

adb rootRestarting the daemon as root

adb usbRestart daemon listening to usb.

adb tcpip<port>Restarting daemon listening on TCP port.

adb ppp<tty>[Options] Start service via USB.
Note: you should not automatically start a PPP connection.<tty>It refers to the tty for PPP stream. Eg. dev: / dev / omap_csmi_tty1
Options:
defaultroute debug dump local notty usepeerdns

FastBoot commands
FastBoot is a console application for PC. Used to act on sections

fastboot devicesList of attached devices in fastboot mode.
fastboot flash<section><file>Sews the .img file to the device partition.

fastboot erase<section>Erase section.
Sections:boot, recovery, system, userdata, radio
Example:fastboot erase userdataErase user data.

fastboot update<filename.zip>Firmware from file filename.zip

fastboot flashallFirmware boot + recovery + system.

fastboot getvar<variable_name>Show bootloader variables.
Example: fastboot getvar version-bootloaderGet the bootloader version.

fastboot boot<kernel> [<ramdisk>]Download and download kernel.

fastboot flash: raw boot<kernel> [<ramdisk>] Create a bootimage and flash it.

fastboot devicesShow the list of connected devices.

fastboot continueContinue with autoload.

fastboot rebootReboot the machine.

fastboot reboot-bootloaderReload device bootloader mode.
Before the fastboot commands, you can use the keys:
-w wipe user data and cache
-s<serial number>Specify the serial number of the device.
-p<product>Specify the name of the device.
-c<cmdline>Override kernel commandline.
-i<vendor id>Manually specify the USB vendor id.
-b<base_addr>Specify the kernel base address manually.
-n<page size>Specify the size of nand pages. the default is 2048.
Firmware radio.
Rename the radio to radio.img and put it in the ADB folder.
@echo off
fastboot reboot-bootloader
echo After booting the bootloader, press any key ...
pause
fastboot flash radio radio.img
fastboot reboot

Recovery firmware from backup.
@echo off
fastboot reboot-bootloader
echo After booting the bootloader, press any key ...
pause
fastboot flash userdata data.img
fastboot flash system system.img
fastboot flash boot boot.img
fastboot reboot

Flash animation when loading
Downloading bootanimation. Rename the file to bootanimation.zip and put it in the ADB folder.
@echo off
adb remount
adb push bootanimation.zip / data / local

Getting SuperCID (Debrending
@echo off
adb devices
fastboot reboot-bootloader
echo After booting the bootloader, press any key ...
pause
fastboot oem writecid 11111111
fastboot reboot-bootloader
fastboot getvar cid
fastboot reboot

Firmware recovery.
Unpack the image of the recovery. Rename the file to recovery.img and put it in the folder with ADB.
@echo off
fastboot reboot-bootloader
echo After booting the bootloader, press any key ...
pause
fastboot flash recovery recovery.img
fastboot reboot

Firmware boot partition
Rename the piece of firmware responsible for loading to boot.img and put it in the ADB folder.
@echo off
fastboot reboot-bootloader
echo After booting the bootloader, press any key ...
pause
fastboot flash boot boot.img
fastboot reboot

Debugging
What is LogCat and how to use it?
How to remove logcat in various ways and applications
adb logcat [<Keys>] [<filter>] View logs with debug information:

You can use the logcat command from a development machine.
$ adb logcat
or from remote shell
# logcat Each log message in Android has a tag and priority
The tag is a string indicating the system component from which the message was received (for example: View for the view system)
Priority - has one of the following values ​​(in order from lowest to highest):
V - Verbose (Low priority).
D - Debug
I - Info
W - Warning
E - Error
F - Fatal
S - Silent (The highest priority at which nothing is output).

Get a list of tags used in the system, along with their priorities, you can run logcat. The first two columns of each displayed message will be listed.<a priority>/<tag>.
An example of the displayed logcat message:
I / ActivityManager (585): Starting activity: Intent {action = android.intent.action ...}

To reduce log output to an acceptable level, filter expressions should be used. Filter expressions allow the system to specify the desired combinations.<tag>and<a priority>, the remaining messages are not displayed by the system.
Filter expressions have the following format.<tag>:<a priority>... where<tag>indicates the desired tag,<a priority>indicates the minimum priority level for the selected tag. Messages with the selected tag and priority at or above the specified level are recorded in the log. Any number of pairs can be used.<tag>:<a priority>in one filter expression. To separate pairs<tag>:<a priority>space is used.

The example below logs all messages with an "ActivityManager" tag with a priority of "Info" or higher, and messages with a "MyApp" tag and a priority of "Debug" or higher:
adb logcat ActivityManager: I MyApp: D *: S
The last element in the filter expression *: S sets the priority "silent" for all other tags, thereby ensuring the display of messages only for "View" and "MyApp". Using *: S is a great way to log only explicitly specified filters (that is, the white list of messages is indicated in the filter expression, and *: S sends everything else to the black list).

The following filter expression displays all messages with a priority of "warning" or higher for all tags:
adb logcat *: W

If logcat runs on the developer’s machine (not via the remote adb shell), you can also set the value of the default filter expression by setting the ANDROID_LOG_TAGS environment variable:
export ANDROID_LOG_TAGS = "ActivityManager: I MyApp: D *: S"

Please note that specifying the ANDROID_LOG_TAGS environment variable will not work in the emulator / device if you use logcat in a remote shell or using adb shell logcat.
The export command described above works in OS * nix and does not work in Windows.

Monitoring Log Output Format

Log messages in addition to tag and priority contain several metadata fields. You can change the message output format showing only specific metadata fields. To do this, use the -v option and specify one of the following output formats.

briefShow priority / tag and process PID (default format).
processOnly show PID.
tagOnly show priority / tag.
threadShow only process: thread and priority / tag.
rawShow unprocessed message, without metadata fields.
timeShow date, call time, priority / tag and process PID.
longShow all metadata fields and separate messages with empty lines.

When runninglogcatYou can specify the output format using the -v parameter:
adb logcat [-v<format>]
An example that shows messages in the thread format:
adb logcat -v thread
It should be noted that only one format can be used with the -v option.

View alternate log buffer

The Android logging system holds several ring buffers for the message log and not all messages are sent to the main buffer. To display additional log messages, you need to run logcat with the -b parameter.

Thus you can see one of the alternative buffers:
radio View radio / phone related buffer.
events View a buffer with event related messages.
main View the main buffer (default).

The example below shows a buffer with radio and telephone messages:
adb logcat -b radio

View stdout and stderr

By default, the Android system sends the output of stdout and stderr (System.out and System.err) to / dev / null (deletes). In processes that run on a Dalvik virtual machine (Dalvik VM), a copy of the output to the log file can be written. In this case, the system writes messages to the log using the stdout and stderr tags with priority I.
To redirect output, you need to stop the emulator / device, then execute the shell setprop command to enable output redirection. An example of how this is done:
$ adb shell stop
$ adb shell setprop log.redirect-stdio true
$ adb shell start

The system saves this setting while the emulator / device is running. To use this default setting in the emulator / device, you need to add this command to/data/local.propin the emulator / device.

List of logcat command options
-b<buffer>Load an alternate log buffer for viewing, such as event or radio. The main buffer is used by default.
-c Clear (reset) the log and exit.
-d Display the log and exit.
-f<filename>Write log messages to file<filename>. The default is stdout.
-g Display the size of the specified log buffer and exit.
-n<count>Set the maximum number of log rotations (the number of stored compressed log fragments)<count>. The default is 4. Requires the -r option.
-r<kbytes>Perform rotation every<kbytes>output (split the log into fragments by<kbytes>). The default is 16. Requires the -f option.
-s Set the default silent filter.
-v<format>Sets the format for displaying log messages. The default is brief.
Useful
List of PC software for file system GUI via ADB
How to translate into flight mode xiaomi on androyd 10 cherep adb and back?

Useful scripts

Shell scripts for Android
adb shell<shell command>The command is sent through the shell.
Example: adb shell rm -r / system / sd / appRemove applications installed on the memory card.
Example: adb shell rm -r / system / sd / app-privateDeleting applications installed on the memory card in the private section.
Example: adb shell cat / proc / mtdIt will give information about the sections of the internal memory of the device.
It will give something like:
dev: size erasesize name
mtd0: 000a0000 00020000 "misc"
mtd1: 00420000 00020000 "recovery"
mtd2: 002c0000 00020000 "boot"
mtd3: 0fa00000 00020000 "system"
mtd4: 02800000 00020000 "cache"
mtd5: 0af20000 00020000 "userdata"

Example: adb shell dfIt will display information about free resources in the memory sections of the device.
It will give something like:
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 160664 0 160664 0% / dev
/ dev / block / mtdblock4 40960 1292 39668 3% / cache
/ dev / block / mtdblock3 256000 146888 109112 57% / system
/ dev / block / mtdblock5 179328 125728 53600 70% / data
/ dev / block / mmcblk0p1 15521280 10056880 5464400 65% / sdcard

Create a file with the extension .cmd or .bat in the folder with the ADB (check that .cmd or .bat is the file extension and not its name) and write there:
copy block (set block and outgoing name)
adb shell su -c dd if = / dev / block / mmcblk0p9 of = / sdcard / factoryfs.img bs = 4096


find out what blocks there are in general
adb shell cat / proc / partitions


Example:
adb shell mount -o rw / dev / block / mtdblock3 / system
adb shell mount -o rw / dev / block / mtdblock5 / data

Mount partitions / system and / data in ClockworkMod recovery mode.

unlock from the pattern on the lock (after the command to enter any gesture)
adb shell rm /data/system/gesture.key

Graphic lock. Screen lock code - problem solving.

Stop ADB service.
@echo off
taskkill / f / im adb.exe

A few words about the modes of the phone
Getting the logcat of a specific application
Enter the ADB / Fastboot commands to another phone



Download:
Platform-tools (adb & fastboot) r30.0.5
Platform-tools (adb & fastboot) r23.1.0 Windows xp
Platform-tools (adb & fastboot) For Android

Past versions
Platform-tools (adb & fastboot) r30.0.4
Platform-tools (adb & fastboot) r30.0.3
Platform-tools (adb & fastboot) r30.0.2
Platform-tools (adb & fastboot) r30.0.1
Platform-tools (adb & fastboot) r30.0.0
Platform-tools (adb & fastboot) r29.0.6
Platform-tools (adb & fastboot) r29.0.5
Platform-tools (adb & fastboot) r29.0.4
Platform-tools (adb & fastboot) r29.0.3
Platform-tools (adb & fastboot) r29.0.2
Platform-tools (adb & fastboot) r29.0.1
Platform-tools (adb & fastboot) r29.0.0
Platform-tools (adb & fastboot) r28.0.3
Platform-tools (adb & fastboot) r28.0.2
Platform-tools (adb & fastboot) r28.0.1
Platform-tools (adb & fastboot) r28.0.0
Platform-tools (adb & fastboot) r27.0.1
Platform-tools (adb & fastboot) r27.0.0
Platform-tools (adb & fastboot) r26.0.2
Platform-tools (adb & fastboot) r26.0.1
Platform-tools (adb & fastboot) r26.0.0
Platform-tools (adb & fastboot) r26.0.0-RC2
Platform-tools (adb & fastboot) r26.0.0-RC1
Platform-tools (adb & fastboot) r25.0.6
Platform-tools (adb & fastboot) r25.0.5
Platform-tools (adb & fastboot) r25.0.4
Platform-tools (adb & fastboot) r25.0.3
Platform-tools (adb & fastboot) r25.0.2
Platform-tools (adb & fastboot) r25.0.1
Platform-tools (adb & fastboot) r25.0.0
Platform-tools (adb & fastboot) r24.0.4
Platform-tools (adb & fastboot) r24.0.3
Platform-tools (adb & fastboot) r24.0.2
Platform-tools (adb & fastboot) r24.0.1
Platform-tools (adb & fastboot) r24
Platform-tools (adb & fastboot) r24 RC3
Revision 24 RC2 (version from the channel update Preview)
Revision 22
Android SDK platform-tools (adb, fastboot) and usb-driver


Topics Curator:Displax


Post has been editedDisplax - 16.11.20, 12:59



Rep: (12)
* uti_putin,
Yes, Sberbank continues to see him.
P.S As they answered, via ADB does not delete APK. Other ways I do not see (there is no root, TWRP is not, the editing of the ZIP firmware without the ability to install through the TVP does not make sense, since the checksums will not comply, there are no other firmware).



Rep: (520)
Yurik39 @ 1.08.19, 16:12*
Sberbank continues to see him.
Options:
1. Patched Sber
2. Try the anti-virus third partner to hide this file (it is not a fact that it has an assessment from the Solovskaya coincide)



Rep: (16)
Slava.Landau @ 08/01/19, 15:33*
PS It seems to happen ...

The Custom Navigation Bar application seems to work after write_secure_settings But immediately appeared on top of all windows of the "graphical interface error" and the new phone no longer earned! Made a discharge to factory and threatened a bunch of information
Staring from all sorts of ruts but thought adba will not threaten the body, it's not a root, and here it happened

Post has been editedslava.landau - 01.08.19, 23:08



Rep: (1968)
* slava.landau, And what is the ADB? It honestly fulfilled your request and provided additional rights to change the system settings installed by you by you, the Custom Navigation Bar application, which, together with you, broke.



Rep: (16)
Vitaly51370 @ 08/02/19, 07:18*
It honestly fulfilled your request and provided additional rights.

Here I agree.



Rep: (6839)
Platform-tools (adb & fastboot)R29.0.2.
Screenshot
Attached Image

Changes:
  • adb
    • Fixes a Windows heap integrity crash.
  • fastboot
    • Adds support for partition layout of upcoming devices.
https: //android.google…m/core/+log/master/adb
https: //android.google...e/+log/master/fastboot

Download:
Attached filetools_r29.0.2-windows.zip(2.22 MB)
Attached fileTools_R29.0.2-linux.zip.(2.95 MB)
Attached fileTools_r29.0.2-macosx.zip.(2.94 MB)

USB Driver: Attached fileusb_driver_r11-windows.zip (8.28 MB)



Rep: (1094)
* anti-kontr , Maybe it's worth more carefully examine instructions for use?



Rep: (-2)
VM7 may be worth it, but I do not see errors, everything in the manual, copied to the root, created the file, listed the data into it. Where is the error?
Maybe it was worth it just to answer on the fact if you see somewhere the mistake?)

Post has been editedanti-kontr - 03.08.19, 18:10



Rep: (6839)
* anti-kontr,
ADB and all that with it you can do (Post Displax # 83914118)



Rep: (212)
anti-kontr @ 03.08.19, 17:08*
It may be worth it, but I do not see any errors, all of a manual, copy the root, create a file that has brought him the data. where the error here?
You run cmd not from the directory where you installed adb

Post has been editedAlexMikle - 03.08.19, 18:38



Rep: (12)
Who in the subject, why the PC can not see bodies in fastbuta mode - a scratching, plc!PC does not see the phone in fastboot ... But see!



Rep: (1025)
* lllightman , In fastboot mode Xiaomi fully working with an unlocked bootloader. You have said, but again, you - Unlocking XIAOMI bootloaders . There have all the answers

Posted on 08/04/2019, 14:05:

anti-kontr @ 3.08.19, 19:29*
Yes nifiga not get anything clumsy you all what that
What's interesting, it does not get you, and clumsy - we. Before you somehow did not complain. We are confident that the problem is not on your side?

Post has been editedFidelich - 04.08.19, 14:06



Rep: (33)
A batch can install applications?



Rep: (159)
Good afternoon, it is possible to use the adb script from recovery, the samsung galaxy tab a6 tablet (sm-t585), android 7
It costs kaspersky endpoint security 10. He became an administrator and it is not possible to remove it (he went through synchronization with the server, set a security policy and no longer communicates with the server, that is, it became unmanaged in general). You cannot run wipe from recovery, apparently it is modified. Mount system - error. Developer mode is not activated (or rather, it is activated, but there is no item to connect to the PC and delete the program via adb).
It remains possible to remove the program using the adb script, can this be done?
What do you need to know in advance about the package name? (Is it possible to install the application on another device and find out its name, etc. Or is it generated every time a new one?)



Rep: (6839)
Leliil @ 06.08.19, 13:55*
Perform a wipe of recovery can not, apparently, it is modified.
Once there is no point to reset, it means, most likely, stock, and therefore, there are no scripts can not be.
Boot into safe mode and delete from there. Well, or if it does not - I beg to cleaning.



Rep: (159)
* Displax , there is a wipe item, but it gives an error, something like this:
/ misk failed
There is also an item about the adb script.
I thought mount needs to be done, but gives the same error

Post has been editedLeliil - 06.08.19, 16:57



Rep: (1094)
Leliil @ 6.08.19, 17:56*
There is also an item about the adb script.
You are about adb sideload? It's not about the script.



Rep: (159)
* vm7 , tomorrow I can definitely say, the tablet is at work.



Rep: (1)
Hello, the question of ADB. Phone Samsung A3 2017 rue and there was not. Climbed through the ADB, to turn the SD-card to the internal memory (through command $sm partition disk: 179,32 private ). After entering the command gets the following empty string with $, and all. Magic does not happen, no formatting, etc. although $ adb shell and $ sm list-disks It worked. Also, if you enter sm set-force-adoptable true Nothing happens, the map is not overridden, the possibility of its format as vnut memory does not appear. Android 8.0. Tell me what's wrong doing. Ruth is impossible.



Rep: (932)
Benson9999 @ 06.08.2019, 08:41*
batch install applications?
adb
shell
su
find "/ put_k_direktorii_s_apk-ashkami_na_devayse" -iname '* .apk' -print0 | xargs -0 -n1 pm install
P.S .: under the command need root and busybox on a device

There is another option: without busybox on a device (a little more complicated), apk-Ashka on PC - choose.

Post has been editedSeryoga - 06.08.19, 22:50


Full version    

Help     rules

Now: 16.01.21, 10:22