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.0.tar.gz (13.0 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.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for robotframework_adblibrary-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3393f37746a3ad48c1b23a319950debea980220e7970841a8f29a46c35670142
MD5 7e7b02094f2b8727a7cb1fcc2aa25bd5
BLAKE2b-256 ce0b76e61f2f1d29d0c74d7164c4ced11e56cf23e53f1420544213b6dcb5e0ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for robotframework_adblibrary-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9ad6038fd344b72bcaf41017290b5ff0a091a0f585f4eb8f4fe766e5c70c6c2
MD5 22f32ed5fc74bc568be5795027f9e502
BLAKE2b-256 61d71dcf53523ead8c2b9dc7c6bba0f6ef14a916136a52f50f31db55c1df5eac

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