ADBLibrary for Robot Framework
==============================
**ADBLibrary** is a custom Robot Framework library that provides Android Debug Bridge (ADB) functionalities for automated testing and device control.
It enables seamless interaction with Android devices through ADB commands, making it ideal for client-side testing, device orchestration, and CI/CD pipelines.
---
## Features
- Execute `adb` and `adb shell` commands
- Manage multiple connected Android devices
- Switch between USB and TCP/IP connections
- Install, uninstall, and inspect APKs
- Capture logs, screenshots, and device metadata
- Simulate input events and browser interactions
- Push/pull files between host and device
- Root/unroot access control
- Built on a proxy design pattern for scalable multi-device support
-------------------------------------------------------------------------------
PREREQUISITES
=============
Before using this library, ensure the following are installed on your system:
1. ADB (Android Debug Bridge)
---------------------------------
ADB is required to communicate with Android devices.
On Ubuntu/Debian systems:
``` sh
$ sudo apt-get update
$ sudo apt-get install adb
```
On macOS using Homebrew:
```
$ brew install android-platform-tools
```
Alternatively, download ADB tools from:
https://developer.android.com/studio/releases/platform-tools
2. Root Access (IMPORTANT)
---------------------------------
If you want to access the **full set of functionalities** provided by ADBLibrary,
your Android device must be connected with **root access enabled**.
-------------------------------------------------------------------------------
## Supported Devices
| Device Type | Supported Features |
|-------------|----------------------------------------------------------|
| Rooted | Full access to all keywords |
| Unrooted | Limited access: connection, shell commands, metadata queries |
-------------------------------------------------------------------------------
INSTALLATION
============
1. Clone the repository (if not already):
$ git clone https://github.com/yourusername/ADBLibrary.git
$ cd ADBLibrary
2. Install Python dependencies:
$ pip install -r requirements.txt
Note: It is recommended to use a virtual environment.
3. (Optional) Reload your profile if 'adb' is not recognized:
$ source ~/.profile
-------------------------------------------------------------------------------
SETUP
=====
Refer to the following setup diagram to connect your Android device and verify ADB:

-------------------------------------------------------------------------------
EXAMPLE USAGE IN ROBOT FRAMEWORK
================================
``` robot
*** Settings ***
Library ADBLibrary
*** Variables ***
${ADB_DEVICE} 10000000cd0c07a6
${DEVICE_IP} 192.168.1.103
${PORT} 5555
${ADB_NETWORK_DEVICE} ${DEVICE_IP}:${PORT}
${INTERFACE} wlan0
${PACKAGE} com.joeykrim.rootcheck
${TIMEOUT} ${5}
*** Test Cases ***
TC001 - Basic ADB Operations
[Documentation] Verifies core ADB operations including starting the ADB server, creating a USB connection,
... executing shell and ADB commands, and disconnecting the device.
Start Adb Server
Create Connection type=usb device_id=${ADB_DEVICE}
${model} Execute Shell Command getprop ro.product.model
Log To Console \nModel: ${model}
${version} Execute Command adb shell getprop ro.build.version.release
Log To Console \nAndroid Version: ${version}
Disconnect Device
TC002 - Network Connection and Device Metadata
[Documentation] Verifies network-based ADB connection setup. Includes enabling TCP/IP mode, creating a
... network connection, retrieving Android version, switching between devices, and fetching
... device metadata such as build product, hardware name, state, and serial number.
Create Connection type=usb device_id=${ADB_DEVICE}
Enable Tcpip Mode port=${PORT}
Create Connection type=network device_ip=${DEVICE_IP} port=${PORT}
${version} Get Android Version
Log To Console \nAndroid Version: ${version}
Switch Connection device_id=${ADB_DEVICE}
${connection} Get Connection
Log To Console \nCurrent Connection: ${connection}
${product} Get Build Product
Log To Console \nBuild Product: ${product}
${hardware} Get Hardware Name
Log To Console \nHardware Name: ${hardware}
${state} Get State
Should Be Equal ${state} device
${serial_number} Get Serial Number
Should Be Equal ${serial_number} ${ADB_DEVICE}
Close All Connections
```
-------------------------------------------------------------------------------
PROJECT STRUCTURE
=================
``` sh
ADBLibrary/
├── doc/
│ └── ADBLibrary.html # Auto-generated keyword documentation (via libdoc)
│ └── IMAGE1.png # Optional setup or architecture diagram
├── LICENSE.txt # Apache License 2.0
├── README.md # Project overview and usage instructions
├── requirements.txt # Python dependencies
├── setup.py # Packaging and distribution configuration
├── src/
│ ├── ADBLibrary/
│ │ ├── adb_library.py # Main Robot Framework library class (with @library decorator)
│ │ └── __init__.py # Entry point for libdoc and version declaration
│ ├── core/
│ │ ├── adb_connection.py # Low-level ADB connection handling
│ │ ├── adb_interface.py # Interface definitions and command abstractions
│ │ ├── adb_proxy.py # Proxy design pattern for multi-device orchestration
│ │ └── __init__.py # Core module initializer
│ └── __init__.py # Root src initializer (optional for packaging)
└── test/
└── test.robot # Sample Robot Framework test suite using ADBLibrary
```
-------------------------------------------------------------------------------
DOCUMENTATIONS
==============
Refer to the following file for help with the available functionalities in the ADBLibrary:
[ADBLibrary Keyword Reference](doc/ADBLibrary.html)
You Can regenerate this using:
``` sh
$ libdoc ADBLibrary ADBLibrary.html
```
-------------------------------------------------------------------------------
LICENSE
=======
This project is licensed under the Apache License 2.0.
https://www.apache.org/licenses/LICENSE-2.0
-------------------------------------------------------------------------------
CONTRIBUTIONS
=============
Contributions are welcome! Feel free to:
- Submit pull requests
- Open issues
- Suggest new keywords or enhancements
Let’s build a powerful ADB automation ecosystem together.
Raw data
{
"_id": null,
"home_page": "https://github.com/ganesanluna/ADBLibrary",
"name": "robotframework-adblibrary",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "robotframework, adb, android, automation, testing",
"author": "Ganesan Selvaraj",
"author_email": "ganesanluna@yahoo.in",
"download_url": "https://files.pythonhosted.org/packages/37/17/8a5a30dd24316d54062458f86eff3bae7f9aef9f457852b8bb2f44834866/robotframework_adblibrary-0.1.3.tar.gz",
"platform": null,
"description": "ADBLibrary for Robot Framework\n==============================\n\n**ADBLibrary** is a custom Robot Framework library that provides Android Debug Bridge (ADB) functionalities for automated testing and device control.\n\nIt enables seamless interaction with Android devices through ADB commands, making it ideal for client-side testing, device orchestration, and CI/CD pipelines.\n\n---\n\n## Features\n\n- Execute `adb` and `adb shell` commands\n- Manage multiple connected Android devices\n- Switch between USB and TCP/IP connections\n- Install, uninstall, and inspect APKs\n- Capture logs, screenshots, and device metadata\n- Simulate input events and browser interactions\n- Push/pull files between host and device\n- Root/unroot access control\n- Built on a proxy design pattern for scalable multi-device support\n\n-------------------------------------------------------------------------------\n\nPREREQUISITES\n=============\n\nBefore using this library, ensure the following are installed on your system:\n\n1. ADB (Android Debug Bridge)\n ---------------------------------\n\n ADB is required to communicate with Android devices.\n\n On Ubuntu/Debian systems:\n ``` sh\n $ sudo apt-get update\n $ sudo apt-get install adb\n ```\n On macOS using Homebrew:\n ```\n $ brew install android-platform-tools\n ```\n Alternatively, download ADB tools from:\n https://developer.android.com/studio/releases/platform-tools\n\n2. Root Access (IMPORTANT)\n ---------------------------------\n\n If you want to access the **full set of functionalities** provided by ADBLibrary,\n your Android device must be connected with **root access enabled**.\n\n-------------------------------------------------------------------------------\n## Supported Devices\n\n| Device Type | Supported Features |\n|-------------|----------------------------------------------------------|\n| Rooted | Full access to all keywords |\n| Unrooted | Limited access: connection, shell commands, metadata queries |\n\n-------------------------------------------------------------------------------\n\nINSTALLATION\n============\n\n1. Clone the repository (if not already):\n\n $ git clone https://github.com/yourusername/ADBLibrary.git\n $ cd ADBLibrary\n\n2. Install Python dependencies:\n\n $ pip install -r requirements.txt\n\n Note: It is recommended to use a virtual environment.\n\n3. (Optional) Reload your profile if 'adb' is not recognized:\n\n $ source ~/.profile\n\n-------------------------------------------------------------------------------\n\nSETUP\n=====\n\nRefer to the following setup diagram to connect your Android device and verify ADB:\n\n\n\n-------------------------------------------------------------------------------\n\nEXAMPLE USAGE IN ROBOT FRAMEWORK\n================================\n``` robot\n*** Settings ***\nLibrary ADBLibrary\n\n\n*** Variables ***\n${ADB_DEVICE} 10000000cd0c07a6\n${DEVICE_IP} 192.168.1.103\n${PORT} 5555\n${ADB_NETWORK_DEVICE} ${DEVICE_IP}:${PORT}\n${INTERFACE} wlan0\n${PACKAGE} com.joeykrim.rootcheck\n${TIMEOUT} ${5}\n\n\n*** Test Cases ***\nTC001 - Basic ADB Operations\n [Documentation] Verifies core ADB operations including starting the ADB server, creating a USB connection,\n ... executing shell and ADB commands, and disconnecting the device.\n Start Adb Server\n Create Connection type=usb device_id=${ADB_DEVICE}\n ${model} Execute Shell Command getprop ro.product.model\n Log To Console \\nModel: ${model}\n ${version} Execute Command adb shell getprop ro.build.version.release\n Log To Console \\nAndroid Version: ${version}\n Disconnect Device\n\nTC002 - Network Connection and Device Metadata\n [Documentation] Verifies network-based ADB connection setup. Includes enabling TCP/IP mode, creating a\n ... network connection, retrieving Android version, switching between devices, and fetching\n ... device metadata such as build product, hardware name, state, and serial number.\n Create Connection type=usb device_id=${ADB_DEVICE}\n Enable Tcpip Mode port=${PORT}\n Create Connection type=network device_ip=${DEVICE_IP} port=${PORT}\n ${version} Get Android Version\n Log To Console \\nAndroid Version: ${version}\n Switch Connection device_id=${ADB_DEVICE}\n ${connection} Get Connection\n Log To Console \\nCurrent Connection: ${connection}\n ${product} Get Build Product\n Log To Console \\nBuild Product: ${product}\n ${hardware} Get Hardware Name\n Log To Console \\nHardware Name: ${hardware}\n ${state} Get State\n Should Be Equal ${state} device\n ${serial_number} Get Serial Number\n Should Be Equal ${serial_number} ${ADB_DEVICE}\n Close All Connections\n```\n-------------------------------------------------------------------------------\n\nPROJECT STRUCTURE\n=================\n``` sh\nADBLibrary/\n\u251c\u2500\u2500 doc/\n\u2502 \u2514\u2500\u2500 ADBLibrary.html # Auto-generated keyword documentation (via libdoc)\n\u2502 \u2514\u2500\u2500 IMAGE1.png # Optional setup or architecture diagram\n\u251c\u2500\u2500 LICENSE.txt # Apache License 2.0\n\u251c\u2500\u2500 README.md # Project overview and usage instructions\n\u251c\u2500\u2500 requirements.txt # Python dependencies\n\u251c\u2500\u2500 setup.py # Packaging and distribution configuration\n\u251c\u2500\u2500 src/\n\u2502 \u251c\u2500\u2500 ADBLibrary/\n\u2502 \u2502 \u251c\u2500\u2500 adb_library.py # Main Robot Framework library class (with @library decorator)\n\u2502 \u2502 \u2514\u2500\u2500 __init__.py # Entry point for libdoc and version declaration\n\u2502 \u251c\u2500\u2500 core/\n\u2502 \u2502 \u251c\u2500\u2500 adb_connection.py # Low-level ADB connection handling\n\u2502 \u2502 \u251c\u2500\u2500 adb_interface.py # Interface definitions and command abstractions\n\u2502 \u2502 \u251c\u2500\u2500 adb_proxy.py # Proxy design pattern for multi-device orchestration\n\u2502 \u2502 \u2514\u2500\u2500 __init__.py # Core module initializer\n\u2502 \u2514\u2500\u2500 __init__.py # Root src initializer (optional for packaging)\n\u2514\u2500\u2500 test/\n \u2514\u2500\u2500 test.robot # Sample Robot Framework test suite using ADBLibrary\n```\n-------------------------------------------------------------------------------\nDOCUMENTATIONS\n==============\n\nRefer to the following file for help with the available functionalities in the ADBLibrary:\n\n[ADBLibrary Keyword Reference](doc/ADBLibrary.html)\n\nYou Can regenerate this using:\n``` sh\n$ libdoc ADBLibrary ADBLibrary.html\n```\n-------------------------------------------------------------------------------\nLICENSE\n=======\n\nThis project is licensed under the Apache License 2.0.\nhttps://www.apache.org/licenses/LICENSE-2.0\n\n-------------------------------------------------------------------------------\n\nCONTRIBUTIONS\n=============\n\nContributions are welcome! Feel free to:\n- Submit pull requests\n- Open issues\n- Suggest new keywords or enhancements\n\nLet\u2019s build a powerful ADB automation ecosystem together.\n",
"bugtrack_url": null,
"license": null,
"summary": "Robot Framework library for Android ADB interaction",
"version": "0.1.3",
"project_urls": {
"Documentation": "https://github.com/ganesanluna/ADBLibrary#readme",
"Homepage": "https://github.com/ganesanluna/ADBLibrary",
"Source": "https://github.com/ganesanluna/ADBLibrary",
"Tracker": "https://github.com/ganesanluna/ADBLibrary/issues"
},
"split_keywords": [
"robotframework",
" adb",
" android",
" automation",
" testing"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "26a296cc52b6f7b845bcb8873aec365ed7ebc0725c18c72cb71814cf5c2f4ad2",
"md5": "d948f0bb29c7a5fc64ec2417a96d612c",
"sha256": "93056acb3bee65aa0903e34c0247786e7384db7b6f1f4b0ac3426550a39f771c"
},
"downloads": -1,
"filename": "robotframework_adblibrary-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d948f0bb29c7a5fc64ec2417a96d612c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 26067,
"upload_time": "2025-08-28T12:36:25",
"upload_time_iso_8601": "2025-08-28T12:36:25.416151Z",
"url": "https://files.pythonhosted.org/packages/26/a2/96cc52b6f7b845bcb8873aec365ed7ebc0725c18c72cb71814cf5c2f4ad2/robotframework_adblibrary-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "37178a5a30dd24316d54062458f86eff3bae7f9aef9f457852b8bb2f44834866",
"md5": "4ceffad322d69fb1b5334ffe952be130",
"sha256": "7724d5cdc3eb3a8fd560e5e7e63387e5a624ad4ab82ab18fdf39803bd155bdf1"
},
"downloads": -1,
"filename": "robotframework_adblibrary-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "4ceffad322d69fb1b5334ffe952be130",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 26883,
"upload_time": "2025-08-28T12:36:26",
"upload_time_iso_8601": "2025-08-28T12:36:26.661037Z",
"url": "https://files.pythonhosted.org/packages/37/17/8a5a30dd24316d54062458f86eff3bae7f9aef9f457852b8bb2f44834866/robotframework_adblibrary-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-28 12:36:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ganesanluna",
"github_project": "ADBLibrary",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "robotframework",
"specs": []
}
],
"lcname": "robotframework-adblibrary"
}