Basic Android Terminal adb Commands You Should Know

You do not have to be a software developer to find your way around the Android Debug Bridge.

For many of us, the fact is that we can plug our Android phone into a computer and interact with it. Apart from those times when we have broken something and need to fix it, there are several reasons why an advanced Android user would like to talk to their device. To do this, you need to keep some tools and know some commands. This is what we are going to talk about today.

Approved, this will not end - all the discussions will be done for all adb commands, but there are 10 basic commands that everybody should know if they are planning to land with the command line and get dirty.

You will need some tools and make them easy. Visit the site of the Android Developer. If you want additional debugging tools or you can scroll down to the bottom of the page and download command line tools only, you can either install the full Android studio package. Unless you are developing or debugging something on your phone or for it, you only want command line tools.

If you're using Windows, then there is one more step. Go to the manufacturer's page for your device and install adb and Fastboot drivers for Windows. Your computer can talk to your Android device. Go to the forum if you have a stroke (windows can be problematic) and anyone will be able to assist you through it.

Now when we are all on the same page, enable USB debugging on your device (if you need help finding it, see your device manual) and plug your phone into your computer.

here is my.


1. The adb devices command

The adb devices command
The adb devices command

The most important part of the adb device command bunch because it is used to ensure that your computer and Android device are communicating. This is the reason why we are covering it first.

If you are a supporter in the operating system on your computer, then you would like to add the directory along with Android tools to your path. If you are not, there is no worry. Just start your terminal or command console and point to it where you have inserted the removal tool downloaded above.

Once you are certain that you are in the correct folder, type the adb device at the command prompt. If you get a serial number, then you are good to go! If you do not, then make sure that you are in the correct folder and if you are using Windows then you have the device driver installed correctly. And make sure you have USB debugging turned on!

Now when we have everything installed, then let's look at some more commands.


2. The adb push command

The adb push command
The adb push command

If you want to remove your Android device program from your computer, you want to use the adb push command. You'll know the full path of some parameters, such as the file you're pushing, and the whole path to where you want it to be. In the above picture, I am missing a song from my desktop on the music folder on my phone.

Note the excerpts around the path on my computer in slash and command in the file path. Windows uses\ as a directory switch in a file path and Unix uses /. Since file spaces and special characters in the name (I aim to put this on purpose!) You'll need to encrypt the path in quotes.


3. The adb pull command

The adb pull command
The adb pull command

If adb push sends the file to your Android device, then the reason is that the adb pull command will pull them out.

This is what it does, and it works in the same way as the adb push command did. You need to know the path of the file that you want to draw, as well as the path you want to know. You can leave the destination path blank and it will leave the file in your tool folder to make things easier.

In this example, I did it in a difficult way and entered the full path so that you can see how it looks. Remember your backward slash versus backward slash rules here and you will not have any problems.


4. The adb reboot command

The adb reboot command
The adb reboot command

This is what you think - a way to reboot your device from the command line. It's easy to run: just type adb reboot and enter

Before you say "I can just press the button!" You have to understand that these commands can be scripted, and if you need it then your device can reboot between the script. And it's a good Segu at number five.


5. The adb reboot-bootloader and adb reboot recovery commands

The adb reboot-bootloader and adb reboot recovery commands
The adb reboot-bootloader and adb reboot recovery commands

You can only reboot your device, you can specify that it is the bootloader reboot. This is very easy because sometimes buttons are touching the cumbos, and if you have a lot of devices they are hard to remember. Some devices have no way to boot the bootloader without this command. And again, being able to use this command in a script is invaluable.

It's easy to do this, just type the adb reboot-bootloader and press Enter.

Most devices can boot directly in recovery with adb reboot recovery (note that there is no hyphen in it) and nothing can be done. It will not hurt to try anything.


6. The fastboot devices command

The fastboot devices command
The fastboot devices command

When you are working inside the bootloader, adb does not work. You are not yet booting the Android, and debugging tools are not to be contacted with active. You will need to use the fastboot command in its place.

Fastboot Probably the most powerful Android Debug Tool is available, and many devices have not enabled it. If you do, then you need to make sure things are circulating. This is where fastboot device command comes in the game. At the prompt, just type the fastboot device and you should see a serial number, as we saw before the adb devices command.

If things are not working and you are using Windows, then you have a driver problem and you have to source it from the manufacturer.


7. The fastboot unlock command

The fastboot unlock command
The fastboot unlock command

Fastboot unlock process will erase everything on your phone and reset it.

The Holy Grape of Android Command, fastboot flashing unlock one thing, and only one thing - unlocks your bootloader. It is not capable on every phone, even phones that support Fastboot, but we are included in it because if you do not need it, then it is an important part of Android's openness. Google does not care about what we do with the phone until it goes against the rules of Google Play Access, and it also includes an easy way to open it, even if the company that The phone is made, it does not support it.

It's easy to use. Once you've used a fastboot device to make sure everything is communicating, just unlock fastboot flashing at the prompt and press enter. Check out your device, read carefully, and choose wisely.


8. The adb install command

The adb install command
The adb install command

While adb push can copy files to our Android device, adb install the add-ons can install the application actually. You will need to supply that path where you have the .apk file saved, then run it like this: Install adb TheAppName.apk.

If you are updating apps, then you use the -r switch: adb install -r TheAppName.apk. There is also a -s switch that tries to install on the SD card as well as other commands you may never need.

And finally, you can uninstall apps with your package name with adb uninstall package-name-here. There is also a switch in uninstall. The switch app will uninstall the app but all apps will drop data and cache in place.


9. The adb sideload command

The adb sideload command
The adb sideload command

An OTS (over-the-air) update is downloaded as a .zip file by your phone. You can also download that zip file manually and install it without waiting for your phone's update to be updated. The end result was the same as you were waiting for, but we hate waiting.

All you have to do is download the update on your computer. Plug your phone into a computer. Then, reboot your phone into Recovery and choose Apply updates from adb using the volume button up and down. Then jump to your preferred terminal/command line and type adb sideload full-path-to-the-file.zip and press enter. Let things run your course, and you are golden.


10. The adb shell command

The adb shell command
The adb shell command

The adb Shell command confuses a lot of people. There are two ways to use it, one where you send a command to run the device in your command line shell, and one where you actually open the device's commands from your terminal.

In the above image, I am inside the device. There is a lot easier to reach there, just type adb shell and enter. Once inside, you can talk to the actual running operating system on your phone. I will warn you that unless you are not familiar with ashes or bash shell, you have to be careful here because if you are not, things can change fast in the south. Ash and Bash are command shells. They allow you to interact with your phone via commands typed and many people use one or both on their Linux or Mac computers, even if they do not know it. ** It is not DOS so try any dos command. **

Another method of using adb Shell commands is to use its phone to run a shell command without going into the shell. It's easy to use; Type adb shell will replace the permissions on an example file: adb shell chmod666 / sdcard / somefile

Be very careful to run commands directly using these methods.

Lastly, if you want to learn to use this command or if you have anything in your work, then do not forget to write comments.

Post a Comment

0 Comments