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/
│   └── ADBLibrary.html       --> Keywords documentation
│   └── 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 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.2.tar.gz (16.6 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.2-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for robotframework_adblibrary-0.1.2.tar.gz
Algorithm Hash digest
SHA256 24e76aa92f02da6642d555d2faccd984fd2775262539b0f45ade0e31be89098e
MD5 7e7cbde3c5a43cb96a2435dc2bcf8992
BLAKE2b-256 886a97b6fc77ade6136340bd558e475f76f8a973ad1d964aecb76123c02b0b8f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for robotframework_adblibrary-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 955a87f5858c8795d6ec53edbc8ebb4329fd649c36e92cf240fe75c3dec9c4b6
MD5 4388cab830b1f0fcfd0334f0779ac1d2
BLAKE2b-256 35e36cae59d38acb6645ffe0992f8464a686c3092e888448a5d202453792268b

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