objective · web viewilab 2: mobile remote shell android debug bridge objective in this lab, we...

8
iLab 2: Mobile Remote Shell Android Debug Bridge 1 Objective In this lab, we will learn about adb—Android Debug Bridge. It is a utility that is found within the Android Developer Tools. 2 adb Background adb is a command line utility that is used to communicate between a personal computer and an Android Device or an Emulator. Refer to iLab 1 for the background on an Android Emulator. adb has three components: 1. client: adb client is a program that runs on a user’s computer and can be invoked using the adb command. 2. daemon: adb daemon runs on an Android device or an Emulator. 3. server: server is a background process running on a computer to manage the communication link between adb clientdaemon. 3 adb Utility adb is used mainly to do the following things from a computer to an Android Device/Emulator. o Installing apps o Deleting apps o Port forwarding o Executing remote shell commands o Copying files to or from the Emulator/Device o Rebooting Emulator/Device

Upload: others

Post on 06-Aug-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Objective · Web viewiLab 2: Mobile Remote Shell Android Debug Bridge Objective In this lab, we will learn about adb—Android Debug Bridge. It is a utility that is found within the

iLab 2: Mobile Remote Shell

Android Debug Bridge

1 ObjectiveIn this lab, we will learn about adb—Android Debug Bridge. It is a utility that is found within the Android Developer Tools.

2 adb Background adb is a command line utility that is used to communicate between a

personal computer and an Android Device or an Emulator. Refer to iLab 1 for the background on an Android Emulator.

adb has three components:1. client: adb client is a program that runs on a user’s computer

and can be invoked using the adb command.2. daemon: adb daemon runs on an Android device or an Emulator.3. server: server is a background process running on a computer to

manage the communication link between adb clientdaemon.

3 adb Utility adb is used mainly to do the following things from a computer to an

Android Device/Emulator.o Installing appso Deleting appso Port forwarding o Executing remote shell commandso Copying files to or from the Emulator/Deviceo Rebooting Emulator/Device

4 Lab Procedure Connect to the iLab from the link iLab Link. Open a Terminal Window as shown below.

Page 2: Objective · Web viewiLab 2: Mobile Remote Shell Android Debug Bridge Objective In this lab, we will learn about adb—Android Debug Bridge. It is a utility that is found within the

The location of command line adb tool is shown below.

Android Tamer Virtual Machine comes preloaded with two Android Emulators, listed below.

o Test AVD based on Android 2.3.3o Atavd based on Android 4.1

Android Emulator files are located at /home/tamer/.android/avd . You can turn on an emulator via command prompt. Refer to the figure

Point to the following location and start adb as shown in the figure by typing the command: adb devices

Page 3: Objective · Web viewiLab 2: Mobile Remote Shell Android Debug Bridge Objective In this lab, we will learn about adb—Android Debug Bridge. It is a utility that is found within the

4.1 adb Install App Copy SimpleApp.apk from the folder

cp /opt/Arsenal/SDK/extras/google/webdriver/SimpleApp/bin/SimpleApp.apk .

Install by using the command adb install SimpleApp.apk

Open your Android Emulator and you will find Simple App.

Page 4: Objective · Web viewiLab 2: Mobile Remote Shell Android Debug Bridge Objective In this lab, we will learn about adb—Android Debug Bridge. It is a utility that is found within the

Double-click to open SimpleApp.

Page 5: Objective · Web viewiLab 2: Mobile Remote Shell Android Debug Bridge Objective In this lab, we will learn about adb—Android Debug Bridge. It is a utility that is found within the

4.2 adb Shell Commands To open a remote shell on our emulator:

To check the contents of the remote emulator:

Page 6: Objective · Web viewiLab 2: Mobile Remote Shell Android Debug Bridge Objective In this lab, we will learn about adb—Android Debug Bridge. It is a utility that is found within the

Change directory to data folder and check out the contents. Type ps command to see all the processes running on the Android

Emulator.

Look for the following process:

Question 1: What does com.android.phone process represent?

Page 7: Objective · Web viewiLab 2: Mobile Remote Shell Android Debug Bridge Objective In this lab, we will learn about adb—Android Debug Bridge. It is a utility that is found within the

Create a simple .txt file using the editor “nano”

Type some text and save by pressing ‘CTRL+X’

Use adb push command to copy the file to a directory /sdcard/ in the Emulator.

Question 2: Use the adb shell command to verify that the file is present in the target directory. Paste a screenshot in your lab report.

Question 3: Use adb pull command to copy init.rc located in ‘/’ directory in emulator. Explain in clear terms your commands and include a screenshot showing the copied over file in your report.

Question 4: Examine the contents of init.rc file on a local machine by using ‘ nano init.rc ‘ Explain the purpose of the file.

Question 5: Find out the adb command used to remove an app from the Emulator. Capture the commandline adb steps for app deletion in a screenshot and include it in your report.

Page 8: Objective · Web viewiLab 2: Mobile Remote Shell Android Debug Bridge Objective In this lab, we will learn about adb—Android Debug Bridge. It is a utility that is found within the

5 DeliverablesIn a MS Word document, include your answers for the questions highlighted in the iLab and submit it via the Dropbox.