Skip to main content

Robot Framework library for Android ADB interaction

Project description

ADBLibrary for Robot Framework

ADBLibrary is a custom Robot Framework library that provides Android Debug Bridge (ADB) functionalities such as:

  • Executing 'adb' commands
  • Running 'adb shell' commands
  • Managing connected Android devices
  • Capturing outputs from Android devices

This library is useful for Android client testing and automation scenarios involving ADB.


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:

        $ 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.


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:

Setup


EXAMPLE USAGE IN ROBOT FRAMEWORK

*** Settings ***
Library    ADBLibrary


*** Variables ***
${ANDROID_VERSION}   14

*** Test Cases ***
TC001: Get Serial Number
    ${output}  Execute Adb Command    command=adb get-serialno
    Log    Android version is ${output}

TC002: Get Android Version
    ${output}  Get Android Version
    Should Be Equal As Integers  ${output}  ${ANDROID_VERSION}

TC003: Wake Up Screen
    ${stdout}  Get State
    Should Be Equal  ${stdout}  device
    Execute Adb Shell Command    command=input keyevent 224

PROJECT STRUCTURE

ADBLibrary/
├── src/
│   └── ADBLibrary.py         --> Main Robot Framework library
├── doc/
│   └── images/
│       └── IMAGE1.png        --> Setup diagram
├── test/
|   └── sample.robot          --> Sample robot file.
├── requirements.txt          --> Python dependencies
├── README.md                 --> Project description
├── LICENSE.txt               --> Apache License 2.0
├── setup.py                  --> Python packageing file

DOCUMENTATIONS

Refer to the following file for help with the available functionalities in the ADBLibrary:

ADBLibrary Keyword Reference


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 open issues or submit pull requests.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robotframework_adblibrary-0.1.1.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robotframework_adblibrary-0.1.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file robotframework_adblibrary-0.1.1.tar.gz.

File metadata

File hashes

Hashes for robotframework_adblibrary-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7104d3aa84ba09163ffad66e5dedcbf9fda5c0d788c05f6a149200cbeae288ad
MD5 8d93d4056a40b3b0ee6898f2ca534a69
BLAKE2b-256 a5b8f136f1ea6ae49b4569aa8533801aa0949c76e9ecb1b686f333d94ed337b4

See more details on using hashes here.

File details

Details for the file robotframework_adblibrary-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_adblibrary-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1cf77dbf2dcd1b3df5f46b2bc63e275a5b7c0d954223b6e67528343b515365b
MD5 943cffdb7b5b600e1e1673ecd3021c47
BLAKE2b-256 b969b9ce3de8964599899bb5c557f8d852dec8815c3498b7872a5e1ec9b9174f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page