Table of Contents

ADB In Android Studio | Android Debug Bridge

In the previous post, we just set up our first emulator. Now we’re going to have a look at the tool called ADB which stands for Android Debug Bridge.

What is ADB

This is a tool that is used to communicate between the host machine that you are working on and the emulator or even the android device in the case that you’re using an actual device during your analysis. ABD is part of Android SDK so in the case of Linux, the SDK location is usually under your home folder, and inside you will see Android slash SDK. Similarly, in Windows, it will be under your user drive then Android slash SDK. Here you will see a list of directories and inside you’ll see a directory called platform tools.

How to Use ADB

Say you are working on a Linux, Mac, or Windows machine and you have an emulator running or you connect your device through USB then you can use ADB to communicate between the machine and the Android system

Also ReadHow to install Android Studio On Ubuntu

Step 1

ABD is a part of Android SDK so in the case of Linux the location of the SDK is usually under your home folder directory

 

Step 2

You will see the Android folder in your root home directory. Navigate to Android then SDK, inside SDK you will have to go in platform-tools 

 

Step 3

Inside the platform-tools folder, there you will be able to see adb file

 

Step 4

You are going to run adb, for example, Shell, so when you run adb shell it’s going to take you to the shell of the Android device. Before running adb, make sure your mobile emulator from Android Studio is running. 

Run the following command from the present directory to get into the Android Shell

# adb shell

Just like that, we are in the environment of the Android device so within the shell you can do common Linux commands because as you know Android is based on Linux. For example, you can do ‘ls’ and it will list all the files, you can change directory, etc. It’s very similar to your Linux environment, you can just click exit to go back to your system.

You can add ADB to your environment variables since this command will be used by many other tools. We will go into the details of the ADB and its functionality later on. But here we just wanted to show that you don’t really need to install it since it is part of the SDK. Also, it is good to know the location.

Also ReadHow to install Android Studio On Ubuntu

Video Tutorial

 

That’s all.. In this post, we have focused on ADB ( Android Debug Bridge ). We have seen its location on Ubuntu Linux and how we have run it and went into the mobile shell through basic Linux commands because Android is a Linux-based platform. Comment on this post if you require any help about the post.

Leave a Reply

Your email address will not be published. Required fields are marked *