objective · web viewilab 2: mobile remote shell android debug bridge objective in this lab, we...
TRANSCRIPT
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.
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
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.
Double-click to open SimpleApp.
4.2 adb Shell Commands To open a remote shell on our emulator:
To check the contents of the remote emulator:
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?
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.
5 DeliverablesIn a MS Word document, include your answers for the questions highlighted in the iLab and submit it via the Dropbox.