Ten ADB commands you should know android development 2015

ptjqatar
ADB

One of the many reasons why a lot of users chose Android is the ease of use and the many things we can do when we connect our device to the computer. Many times, when you upgrade your phone or tablet to a new version, put a cooked ROM or get superuser (root), we need to have more contact with the device that gives us the program we use at that moment (Odin in Samsung, for example). The ADB (Android Debug Bridge) is a computer program that will serve as a bridge to connect our androids to your computer so you can interact with them in a more "advanced" and completely. Let's see how it's done and some basic commands.
For Linux or Mac users will need to install the Android SDK as explained in the official website . It is not difficult if the aforementioned guidelines are followed.
For those using Windows is as simple as downloading this file , open the zip and unzipsomewhere in the "android-tools" folder. If you do not have drivers installed our phone, we find them and install them. After installing the adb.exe file, we can continue.
It is important to have the "USB Debugging" in our Android enabled so that everything works perfectly

1. Command adb device

location_0
This command is the most important of all because it is the one that will tell us whether our Android device communicates well with the team. After having all the files in the same folder (which we draw before zip), we simply start the console terminal (ADB) and type "adb devices" (without the quotes). If we get a serial number, is that everything is correct. If, however, nothing comes out, we'll have to make sure we have everything well (drivers, USB debugging ...).

2. Command adb push

adb-push
With adb push will move a file directly from your computer to your Android device.This command comes in handy when you want to move files to system directories or when we feel like doing drag & drop and want to practice some console use. To move a file is necessary to know the path of the phone where you want to place. If, for example, we want to move a file to any video, we put it in the android-tools folder we talked about before. Then write in the console: adb push superfreak.mp4 / sdcard / Movies /; and you're on your terminal in the movies folder.

3. adb pull command

adb-pull
On the contrary to the above. If we take a file from our Android and bring to the computer, we simply use the command "adb pull". It is almost the same as we did before. If we remove the file from your phone, for example, spent in the example above, that would be such that: adb pull superfreak.mp4 / sdcard / Movies /; and the file will go to sdcard / Movies / our tools folder on your computer. If we move to a particular directory write, after adb pull and pickup directory command, the path on your computer to which you want to move the file: C: \ Users \ Aitor \ Desktop; to move it to the desktop, for example.

4. Command adb reboot

adb-reboot
Simply does what it says. Restart your device using the console. It's an easy way to restart your phone if you need sometime when we're using ADB. Just type "adb reboot"and you're done. Rebooting ...

5. Commands adb reboot-bootloader and reboot recovery

reboot-bootloader
We can not just restart the device, but also access the bootloader. This is one of the most advantageous tools thus sometimes combinations of buttons become tedious and want to do things in a simpler way. Get the bootloader we can serve for many things (root, change ROM ...). We just type "adb reboot-bootloader" and we'll be inside.
In the case of "reboot recovery" it will serve to enter recovery mode. Many ROMs have by default a dialog box that allows us to restart in this mode, but always good to have another way to access in the room.

6. Command fastboot devices

fastboot-devices
When we are in the bootloader, ADB commands no longer work. This is because we are not even on Android, the operating system of the phone has not quite started yet. In this case, we use the fastboot command.
This may be one of the most powerful of those available commands. Keep in mind thatmany devices do not have it enabled and if so, we need to be sure that both computers are communicating (PC and Android). If we want to know if we have fastboot, we only write "fastboot devices" and should get out a serial number (as in adb devices).
If the command does not work and are in Windows, touch review the drivers and tour the specialized forums for help.

7. fastboot oem unlock command

unlock
The holy grail of Android ADB commands. It does one thing and only one, unlock the Nexus (or HTC by their official tool). If you have a phone from a different manufacturer, we have a different approach in each case (Odin for Samsung, for example). In the latter case, this command does not help us at all. It is included here because even without needing it, is an important part of the system's open source Android.
A Google it does not matter what we do with our devices, and provides us with this tool to unlock the phone. This is something that other companies do not see, and is one of the reasons why many choose Android.
Using it is simple. After having used the fastboot to know that everything is well connected, we just type "fastboot oem unlock" and hit enter. Then look at the terminal plays, read carefully and choose wisely options.
Beware !!: Using "fastboot oem unlock" the content of the device will be erased

8. adb shell command

shell
The adb shell command is one that creates more confusion. There are two ways to use it: one where a command is sent to the device to run in its own shell command line, and one which will truly within the shell command from the terminal. In the picture above, the user is within the shell of the device, viewing files and folders. Getting there is easy, just type "adb shell". Once inside, we can be root if you believe necessary. Unless we are familiar with the implementation of actions by commands, we should not touch anything. You need to be careful at this level. Things can become difficult if not careful.
Usually used for more advanced tasks like changing the permissions of files or folders, or run a script. Simply type "adb shell <command>". An example would be to change the permissions of a file, thus: "adb shell chmod 666 / data / file" Be careful when using this method..

9. adb install command

adb-install
This is a simple command. It will serve to install applications on our android. And like the pull and push commands, we specify the path where you want to position the file to install. An example would move an apk for android-tools folder and then put in the console "adb install Aplicacion.apk." We can also use a command to update a specific application. This is achieved by adding the suffix "-r" to the previous sentence. As would be: "adb install -r Aplicacion.apk".
And as we install, we can also uninstall. There is a command that serves to uninstall applications, this would be: "adb uninstall Aplicacion.apk" If we add a suffix "-k" We will leave the application data and cache memory..

10. Command adb logcat

logcat_0
The adb logcat command is one of the most useful for some users. Especially if you are cooks or application developers. When we write, we returned a wealth of written records various events in system operation. Provides valuable information for the developer because here you can deduce what failure is applicable.
To view the log on the computer screen, just type "adb logcat" and press enter. All may go pretty fast and you may not find what you're looking for. There are two ways to solve this: filters and text output.
The filter is used when a developer put a label on a program site and see what happens right there. If necessary, the creator will give us the necessary judgment to put in the console. Conversely, the output text is easier. We give you all the information logcat,contained in a text file (.txt). To run it, we just put "adb logcat> file.txt" and let it all flow like the wind in the corn fields. When finished, close with CTRL + C. We will find the complete log file stored in the directory in which you are working (possibly android-tools). That file is the one we should send the developer.
It is important to note that the report may take confidential information. We must ensure erase everything that the developer does not want to know about us, opening the text editor (notepad) and erasing what we believe appropriate.

That's it

And that's all. Here are the ten most used Android ADB and help us understand a little more this world commands. Besides sure we will be quite useful now or in the future. If you want to learn more, there are many online manual about this. Although we have seen fit to put these to be the most used and challenged. Hope you would have been helpful.

Post a Comment

0Comments

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Check Now
Accept !