appium-adb

repository·master·Indexed 43 days ago

https://github.com/appium/appium-adb

An ES6 wrapper for the Android Debug Bridge (ADB) providing an async/await interface. Version 16.0.5. It is primarily used by Appium to interact with Android devices, offering utilities for APK installation and management, manifest extraction, and device control commands such as power management, GSM simulation, and root access.

Tokens
13.5K
Snippets
75
Records
90
Agent score
27%

What's inside appium-adb

  1. Run functional tests with environment variables

    master

    Functional tests (e2e tests) run using an Android Virtual Device (AVD). By default, the tests use an AVD named NEXUS_S_18_X86 with API Level 18.

    You can customize the testing environment using the following environment variables:

    • ANDROID_AVD: The name of the AVD to use.
    • PLATFORM_VERSION: The platform version (if set, API_LEVEL is inferred).
    • API_LEVEL: The specific API level to use.
    npm run e2e-test
  2. Use appium-adb in your code

    master

    To use the library, import the ADB class and use the static createADB() method to initialize an instance. Once initialized, you can perform various ADB operations using async/await.

    import { ADB } from 'appium-adb';
    
    const adb = await ADB.createADB();
    console.log(await adb.getPIDsByName('com.android.phone'));
  3. Simulate GSM voice state with gsmVoice()

    master

    Use gsmVoice(state) to simulate different GSM voice registration states.

    Possible values for state:

    • unregistered
    • home
    • roaming
    • searching
    • denied
    • off (alias for unregistered)
    • on (alias for home)
    let state = 'roaming';
    await adb.gsmVoice(state);