ADB Command Support

This post discusses how to use the ADB (Android Debugging Bridge) command line tool with eggPlant Functional to communicate with an Android device.

ADB is a command line tool that lets you communicate with an Android device that is connected over USB, or with an emulator. It allows you to pull data from the device such as application log files, memory usage data, and push and pull applications.This is very useful when doing regression testing, as you can automate the whole process, from pulling the old application from the device to pushing a new application onto the device, and then testing the application itself.
The only SenseTalk you need to use in eggPlant Functional to do this is the Shell() function, which allows you to initiate a command line call on your eggPlant Functional machine.

Downloads Required


Step-by-Step: Set-up Instructions


  1. Download and install the Android SDK on your eggPlant Functional machine here.
  2. Plug the device in over USB to your eggPlant Functional machine.
  3. Create a script in your suite called "adb", and save the below code in that script:

    For Mac:

    params MyCommand

    put shell ("cd /Users/MaxGerrard/Documents/adb/adt-bundle-mac-x86_64-20130729/platform-tools", "./adb" && MyCommand) //Change the cd command to the path of your platform-tools folder.

    For Windows:

    params MyCommand

    shell "c:\windows\system32\cmd.exe", <</c "C:\Program Files (x86)\adt-bundle-windows-x86_64-20130522\sdk\platform-tools\adb" >> && MyCommand && "> adbexperiment.txt"

    shell "c:\windows\system32\cmd.exe", <</c "C:\Program Files (x86)\adt-bundle-windows-x86_64\sdk\platform-tools\adb" >> && MyCommand && "> someFile.txt" //Change the cd command to the path of your platform-tools folder.

    put file "C:\wherever\someFile.txt"

  4. Running an adb command on the device is as simple as running an adb command in your script. You simply pass in any adb command you want to run, as shown below:

    adb "devices" //Find out what devices are connected

    adb "shell dumpsys meminfo -a" //Output the memory information of the device.

Further Resources