This post discusses how to use the ADB (Android Debugging Bridge) command line tool with eggPlant Functional to communicate with an Android device.
Note: You can now use the ADBCall() function for communicating with Android devices, so the method presented here is no longer required. However, we leave this article as a scripting example.
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.
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.
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"
adb "devices" //Find out what devices are connected
adb "shell dumpsys meminfo -a" //Output the memory information of the device.