ADB Android Debug Bridge Android Command, Installing an Application using ADB



ADB Android Debug Bridge Android Command, Installing an Application using ADB, Copying the file from or to an emulator or device



ADB Stand for Android Debug Bridge: Android Debug Bridge (ADB) is a type of tool for command line which let us communicate with connected Android device or emulator. It is a Client Server program that contains following three component :-



  1. Client → It executes on our dev system. We can call a client from shell with the help of issuing an ADB command.
  2. Server → It executes as like background process on our dev system. So the server manage the communicate in between the adb daemon and client.
  3. Daemon → It also executes in the background process on each and all device instance or emulator .

ADB is like a part of the Android SDK platform tools packages, It contains for both clients and servers side program that communicates to each other.



When we start the adb clients, First we will check the already running process of ADB. IF the result is NO, then it begins the server process. When the server will start, it bind to local TCP port and listen the ADB command. Then server will set up the connection to all executing emulator / device instance.


ADB Android Debug Bridge Android
ADB Android Debug Bridge Android


ADB Commands: Following is the format of command issuing with the help of ADB:

adb[-d|-e-s <serialNumbers>]<command>



Installing the Application: Using ADB apps can be install on device or emulator:

adb install <path_to_apk>

where <path_to_apk> id the physical path of such apk file that we want to install on device or emulator.



Confirming the already connected devices or Android: So to confirm the already attached device need to use the device commands. This will print the list of all type of attached emulator or device instance → adb devices

Here is an example of viewing the device command and it's result:

$ adb devices

Attached devices list

emulator-5554 device

emulator-5556 device

emulator-5558 device



where emulator-5558 is the series nos then device is the object that is connected to server of adb.

Simply if there is not any device or emulator is in running mode then adb will return no device result.



Next is Sending the command to the specific devices or emulators; If several devices or emulator objects are executing then we required to specify the object target when issuing the adb command.

Adb -s <serialNumber) <Command>

For an example: adb -s emulator-5556 install as demoTest.apk



Copying the file from or to an emulator or device:



We can use this adb command for push and pull to copy file to and from and emulator or devices.



If we required to copy the file from the device or the emulator there we can use the pull command in adb.

If we like to copy the file from the emulator or the device then we can use push command:

adb push (local> <remote>



From the above command, Local and remote refer to the physical path to the target files or directory on our dev system and on the emulator or device instances (remote server).



Starting and Killing the Server:



To Start the Server Use

Adb start-server

whjen the server start and then it bind to local TCP port 5037. All type of adb client use port 5037 for the communication with the adb servers.



To kill the server use kill-server command as it provide below

adb kill-server



Forwarding the Ports: This is use to forward the request on the specific host ort for different port on emulator or device instance:

adb forward tcp:6100 tcp:7100



Enabling the logcat Logging: This command is sued to view the log reault in our development system



adb logcat





Near Field Communication Support NFC Smart Poster Support













Use of add-ins
Cookies in QTP


Mobile Testing with QTP How to install .ipa files for ipad iphone



Touch Screen Simulating User Gestures


MOBILE APPS    QTP TESTING QUESTIONS  MANUAL TESTING  ANDROID APPS


No comments:

Post a Comment

Popular Posts