ADB command Daquan

Source: Internet
Author: User
Tags root access

Install software: adb install apk (file name. apk)
Reinstall the SOFTWARE: adb install-r apk (file name. apk)
Uninstall APK software: adb uninstall APK (package name. apk)
Check the run log on your phone, which can be used to check for errors: adb logcat
See if your phone is connected, and how many phones are connected: ADB devices
A is the phone path, B is the computer path, meaning: Copy the file from the phone to the computer: ADB pull <A> <B>
A is the phone path, B is the computer path, meaning: Copy the file from the computer to the phone: adb push <B> <A>
Access the phone's Super terminal terminal:adb shell
Re-mount File system: ADB remount
Restart your phone: adb reboot
Restart to recovery interface: ADB reboot recovery
Restart to bootloader interface: ADB reboot bootloader
Show files and folders in this directory: LS
Go to a directory: CD (note separating the slash direction is/)
Get the highest permissions: su
Find device: ADB wait-for-device
Disconnecting: adb kill-server
Start Connection: adb start-server

1. Mobile phone due to replacement, due to change permissions and so on caused by unlimited phone restart or directly unable to boot. Do not brush the machine solution.
Start cmd and chase to the ADB directory.
Enter the following command (shown in parentheses, not for none or unknown) (note case)
ADB shell (should show shell# @android/or similar)
ADB remount (should show remount succeed)
adb shell chmod #权限代码 #/#文件目录 # (Permission code check my other logs, usually 644, file directory example:/system/fonts/droidsans.ttf)
ADB reboot (restart)

2. If the system is damaged due to improper operation, the machine must be brushed, but you want to back up the data.
First, the phone is in rec mode and the rec adb driver (usb-ms mode) is installed.
Then the same, CMD chases to the ADB directory. (followed by a comment)
ADB start-server (then help you find your cell phone)
ADB shell (Request shell user)
# Mount/dbdata (in fact, some online is said to be directly mount/data, but I found that the data on my phone is stored on the dbdata) (another point, this sentence I have not tried, try it yourself, It seems that third-party rec (such as CMW) can be mounted on rec first.
Com.android.providers.contacts, this is your phone book.
Com.android.providers.telephony, this is your message.
How do you get it out? I will not have to explain more, the above has given the ADB copy of the command.

3. Copy Rec to backup the entire system.
, the ADB directory is first pursued.
Then the command is: ADB backup [-system|-nosystem]-all [-apk|-noapk] [-shared|-noshared]-F < file name >
(Just one.)
The following starts to explain (I believe you will look at CMD as well as see what it means)
[-system|-nosystem]
This instruction tells ADB whether to back up with the system when backing up.
If not, the default is-system that the system will be backed up together.
Note that if the system is backed up, the system files will be covered during the restore, which is very bad for the upgraded phone.
I don't know if the ADB has the authority to restore the system files without root, but it is not recommended to do so.
Therefore,-nosystem is the recommended command to be played.

-all
This command must be called up, asking if you want to back up all the apps.
If you add-nosystem instructions, then he will only back up the apps you've installed and won't be backed up with the system app.

[-APK|-NOAPK]
The default is-noapk, which means whether to back up the installed apk together.
If it is-noapk, it will only back up the APK profile (like the game Save settings).
But I would recommend backing up the APK together, as this will not have a version conflict issue.

[-shared|-noshared]
The default is-noshared this will ask you whether or not the phone storage space or SD card files together backup.
I do not know if there is an app installed on the SD card when the command will skip, but if most of the app is installed in the internal space, this can not be played.
(Note: HTC has an apk named Com.android.sharedstoragebackup, which backs up the SD card or cell phone space, so unless you use the-nosystem command, for HTC phones No matter whether there is a-shared mobile phone space data will be backed up).

-F < file name >
This is where you want the computer to exist after the backup is finished.
But remember to hit the file name and the deputy file name must be hit. AB

OK, so I'll give you a better complete command:
ADB backup–system–all–apk–share–f "D:\test\test.ab"

Backup supplement related points:
This way, because some computers do not use the native USB3.0, but the use of independent chips, not directly provided by the chipset, so sometimes the ADB will not be wired or transmission problems, so please connect USB2.0 or connect the native USB3.0.
First please make sure that there is already a mobile driver installed (special emphasis!) As far as the mobile phone driver to find out which phone you are to go to which home official website to look for)
Then please connect your phone to determine if the USB debug mode has started
(Note: USB please set to charge mode or MTP mode do not set to disk or network sharing!) )
You can then use the backup command directly.
Let's say I want to back up the APK, together with the APK, do not back up the SD card or external memory, do not back up to the system app and I want to specify the file name is test, and there is D disk, then the instruction is: adb backup-apk-all-nosystem-f "d:\ Test.ab "

Note 1: File path and file name if there are spaces please remember the path to double quotation marks ""
Example:-F "D:\phone backup\htc j.ab", otherwise there will be a problem.

NOTE 2: If the command does not appear after the backup screen or the ADB display error message, it is possible that ADB did not catch the phone, please use the ADB Devices directive (complete instructions Please enter the ADB view) to see if ADB has caught the phone.
This will ask you to enter the protection password for this backup file, you can choose not to enter. OK, then press "Back up my Profile".
Just wait for it to back up ... Backup of the process, the phone screen will appear in the backup of the APK and information.
After the backup will automatically jump out of the program, and look at the D slot.

Restores:
Since it has been backed up, then how to restore it?
It's time to use another command. ADB restore
I'll just take the Test.ab file as an example.
ADB restore "D:\test.ab"
Entering your phone password and the password you set for your package (if any) will start the restore action, and it will be restored based on the path stored at the start of the backup.
After the restore is successful, you can go to see if the app is back, or check the game to save or set whether it's still there.

Advanced practices and Additional considerations:

Individual program Backup methods:
A lot of people asked me how to back up a single app is good, say simple is not easy, say difficult is not difficult. It's hard to find the object name of the app.
What is an object name? Simply put, the name of the object is the real name of the app, by each app developer (or developer) defined by the Java package name, do not forget that the Android app is written by Java, if you have written Java should be not unfamiliar with the package, The name of the app that we generally see is added.
For example, one of the free games from iOS porting to Android, Temple Run, whose surface name is called Temple Run, but its actual object name is Com.imangi.templerun, and don't think this is the basic format ( What must be in front of COM or something like that), this is entirely the developer's own definition. Although usually developers are to define COM at the beginning of the addition of things, but of course there are very pit Daddy developers, I downloaded tens of thousands of test software has appeared so a novice code is cmw.firstblood.supersystem ... Okay, then I got rid of it after the anti-compilation.
OK, so you probably know that? But how do you look at the object name?
Basically, the application administrator and the work manager are not able to see the object name, you need to install software like APK Manager (like a Super manager), to know the category name of each app.
Special attention! The category names are case sensitive, so check carefully to avoid backup problems.
If you know the name of the object after the command how to fight it? Let's take Temple run as an example.
The ADB directive will be:
ADB backup-apk com.imangi.templerun-f "D:\test.ab"
This way, because just back up a single app data, so do not need to add-nosystem-all-noshared, such as the whole domain instructions, only need to do so simple, and according to your preferences, want to even the APK backup together add-apk.
After entering the opportunity to re-enter the same image as above, just click on the backup, will be the designated app to backup down.

Additional storage location of the information:
Some apps or games are saved, and there may not be any storage space inside the phone, which might be stored on the SD card or the user's storage space on the phone.
Now we know that, like Templerun,subwaysurf, and Line, their records are on the SD card or cell phone storage space, as to how to find them, as long as the SD card (user storage space) to see, there will be an Android folder, There is a data folder, that is, the location of the file, as long as the backup down on it, but note that if you remove the program before the backup, then the data will be removed from the storage space, this also please note.

Restore with Titanium Backup:
That's when I found the information. Titanium Backup also supports the use of ADB backed up data, as long as the version is 5.6 after the line (want to download the titanium Backup connection), so you can also use titanium Backup to restore the action, the disadvantage is that it requires root and must be professional version to support.

Last week, we showed the install ADB and fastboot on any OS. If you ' re not sure why do you ' d want to go to the (relatively minor) trouble, here is just some of the useful things you can Do with these and the other handy tools.

The easiest-to- Install Android ' s ADB and FastBoot Tools on any OS

If you've ever tried to root your an Android phone or flash a ROM, you'll have heard about ADB ... Read more

Disclaimer: These commands is intended to give you the idea of the what the can do with ADB and FastBoot. They is not direct instructions and is commands work on all devices. It's perhaps better to think of the this as a glossary. Due to the sheer number and variety of devices and implementations on the Android world, it's impossible for us to provide Step-by-Step instructions for every a single device. Be sure to the your specific phone or tablet before throwing commands at it.

Manage Your Device with ADB

ADB have a wide variety of functions for managing your device, moving content to and from your phone, installing apps, back ing up and restoring your software, and more. You can use the ADB while your phone are plugged in to a computer. You can also use ADB with your device wirelessly by following these instructions. You'll need to briefly connect your device to your computer with a USB cable for the work, but it should only take a f EW seconds to execute these commands and then your ' re good to use ADB wirelessly if your so choose.

ADB devices
Function: Check connection and get basic information about devices connected to the computer.

When using ADB, this is probably the first one command to run. It'll return a list of all devices so you had connected to your computer. If it returns a device ID like the one seen above, you ' re connected and ready to send commands.

ADB reboot Recovery
Function: Reboot your phone into recovery mode.

A lot of functions-like flashing ROMs-your phone require you-to-boot into recovery mode. Normally, this requires, the particular set of buttons on your phone for a certain length of time, which are Obnoxious. This command allows your to boot directly into recovery mode without performing the complex finger dance of your people.

How to Flash a ROM to Your Android Phone

Android is great, but sometimes, the version of your get with your phone-whether its vanilla Android or ... Read more

ADB Reboot-bootloader
Function: Reboot your phone into bootloader mode.

Along the same lines as the previous command, this one allows you to boot directly to your phone ' s bootloader. Once You "re in the bootloader, ADB won ' t work anymore. That's where FastBoot comes in (which we'll get to in a bit). However, much like the recovery command, it's much easier to boot into your bootloader with a command on your computer tha N a complex series of buttons on your phone.

ADB push [source] [destination]
Function: Copy files from your computer to your phone.

The push command allows the files from your computer to your phone without touching your device. This is particularly handy for copying large files from your computer to your phones like movies or ROMs. In order to use this command, you'll need to know the full file path for both your source and destination. If the file want to copy are already in your Tools folder (where ADB lives), you can simply enter the name of the file As the source.

ADB pull
Function: Copy files from your phone to your computer.

The yin to push's yang, the pull command in ADB allows you to copy files from your phone to your computer. When pulling files, you can choose to leave out the destination parameter. In this case, the file is copied to the folder on your computer where ADB itself lives. You can then move it to wherever you ' d prefer like normal.

ADB install [source.apk]
Function: Remotely install APKs on your phone.

You can use the This command to install the an app on your phone without touching it. While this isn ' t a terribly impressive trick for an app that's on the Play Store (where can already remotely install, Uninstall, and update apps), it's quite handy if you need to sideload an app.

The Google Play Web Store now Lets you Update and Uninstall Apps remotely

Google recently made some nice updates to the Google Play store, but they quietly updated the web ... Read more

ADB Shell [command]
Function: Open or run commands in a terminal on the host Android device.

We Love the terminal here at Lifehacker. There is so many great things you can do with it. Most of us don ' t tend to bother with the terminal in Android because we don ' t want to type long text-based commands on a T Iny touchscreen. However, the ADB shell command allows you-to-open up a full-terminal on the host device. Alternatively, you can type ' adb shell ' followed by a valid terminal command-to-execute just that one command by itself.

Master the Command line this Weekend

Keyboard shortcuts only get to the far. If you really want to harness the real power of your ... Read more

ADB backup
Function: Create a full backup of your phone and save to the computer.

Backing up your Android phone are already something you can and should be doing automatically. However, if you need to create a complete backup before hacking away at something particularly risky, you can create a ful L Backup with a single command. You don't even need root access (though this could mean that some protected data can ' t being backed up). You can read more about the parameters for this command-and there is a lot of them-here.

How to Set up a Fully automated apps and Settings Backup on Android

In a ideal world, your Android ' s apps, their settings, and your system settings would ... Read more

ADB restore
F unction: Restore a backup to your phone.

The corollary to the previous command, ADB restore allows-you-to-a-existing backup file and restore it to your D Evice. So, for example, type "adb restore C:\[restorefile].zip" and your phone would shortly is back to normal.

ADB sideload
Function: Push and Flash custom ROMs and zips from your computer.

This command was a relative newcomer to the ADB field and was only supported by some custom recoveries. However, you can use the This single command to flash a. zip that's on the your computer to your phone. Once again, this allows the flash whole ROMs (or anything else you can flash with a. zip file) without touching your ph One.

These commands is just some of the more useful ones you can use with ADB installed on your computer. Want to use it all the time for everyday tasks, and when you need them, you'll be glad and have them.

Unlock and Modify Your Phone ' s Firmware with FastBoot

As stated in We previous article, FastBoot allows you to send commands to your phone while in the bootloader (the one PLA Ce ADB doesn ' t work). While your can ' t do quite as many things here, the things you can do is awesome, including unlocking certain phones-like N Exuses and certain others-as well as flashing custom recoveries and even some ROMs. It should be noted, though, which is not all phones support fastboot and if you have a locked bootloader, you ' re probably out of luck here. That's being said, here is some of the most useful tools in FastBoot ' s Arsenal.

FastBoot OEM Unlock
Function: Unlock your bootloader, making root access possible.

When people go to about how the "open" Nexus devices is, the "What's they ' re talking about. Most phones require a root exploit to gain superuser access and the ability to heavily modify your phone ' s firmware. With a Nexus device, you can unlock your bootloader with a single command. From there, you'll be allowed to install custom recoveries or give yourself root access.

It should is noted, this command would also completely wipe your phone. This means it's a great command to run when you get a brand new phone and if you've been using yours for a while and do a BA Ckup first.

FastBoot devices
Function: Check connection and get basic information about devices connected to the computer.

This was essentially the same command as ADB devices from earlier. However, it works in the bootloader, which ADB does not. Handy for ensuring so you have properly established a connection.

FastBoot Flash Recovery
Function: Flash a custom recovery image to your phone.

Flashing a custom recovery is an essential part of the rom-swapper lifestyle. As with everything else in the This list, you can install a custom recovery on your device without touching it by using this C Ommand.

ADB command Daquan

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.