Options
All
  • Public
  • Public/Protected
  • All
Menu

Module root_automator

RootAutomator is an object that uses root or adb permissions to simulate touch. It can be used to complete touch and multi-touch, and the execution of these actions is not delayed. Compared to accessibility-based operations, RootAutomator supports multi-touch and dynamically changing gestures, but may not be compatible with all devices.

Index

Functions

createRootAutomator

  • Create a new RootAutomator instance.

    You can specify whether to use root permission, adb permission, input device path, etc, see RootAutomatorOptions. If you don't specify root or adb permission, the default value from getDefaultShellOptions will be used.

    For input device path inputDevice, if you don't specify, it will be automatically detected, but if it fails to detect, it will throw an exception. You can run getevent -t in terminal, then move your finger on the screen, and see the input device path, like /dev/input/event5.

    example
    "nodejs";
    const { createRootAutomator } = require("root_automator");
    async function main() {
        const ra = await createRootAutomator({root: true});
        await ra.tap(100, 100);
        await ra.exit();
    }
    main();
    

    Parameters

    Returns Promise<RootAutomator>

Generated using TypeDoc