bat-api
## Installation
Last updated a year ago by sharenaive .
MIT · Original npm · Tarball · package.json
$ cnpm install bat-api 
SYNC missed versions from official npm registry.

Bat-Driver Api

Installation

$ npm i bat-api

Documentation

Usage

const batDriver = require('bat-api');

const remoteConfig = {
    host: 'localhost',
    port: 8090
}

const main = async () => {    
    // create driver handler
    let driver = new batDriver(remoteConfig);

    // bind linstener
    driver.bind('device.del', sn => {
        console.log(sn);
    });

    // call driver by the protocol
    let res = await driver.call('container.idle', {
        type: 'android'
    });

    // init driver, specify the device info
    driver.initDevice({type: 'android', id: 'PBV0216620000092'});

    // call driver by the adb method
    res = await driver.adb.devices();

    // close driver
    driver.close();
}

main();

API

基础 API

bind

绑定监听事件,监听 Bat-driver 的事件推送

Parameters
Name Type Description
method string 监听事件
callback Function 处理函数

close

关闭 Bat-driver 代理


call → { Promise.< Object > }

向 Bat-driver 发起远程方法调用。

通信协议详情请见:./docs/protocol.md

Parameters
Name Type Description
method string 调用方法
payload Function 携带参数
timeout int 调用超时时间
Returns

Type Promise.< Object >


adb


container

Current Tags

  • 1.1.55                                ...           latest (a year ago)

45 Versions

  • 1.1.55                                ...           a year ago
  • 1.1.53                                ...           a year ago
  • 1.1.52                                ...           a year ago
  • 1.1.51                                ...           a year ago
  • 1.1.50                                ...           a year ago
  • 1.1.36                                ...           a year ago
  • 1.1.33                                ...           a year ago
  • 1.1.32                                ...           a year ago
  • 1.1.31                                ...           a year ago
  • 1.1.30                                ...           a year ago
  • 1.1.8                                ...           a year ago
  • 1.1.6                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.62                                ...           a year ago
  • 1.0.61                                ...           a year ago
  • 1.0.60                                ...           a year ago
  • 1.0.52                                ...           a year ago
  • 1.0.51                                ...           a year ago
  • 1.0.50                                ...           a year ago
  • 1.0.33                                ...           a year ago
  • 1.0.32                                ...           a year ago
  • 1.0.30                                ...           a year ago
  • 1.0.27                                ...           a year ago
  • 1.0.26                                ...           a year ago
  • 1.0.25                                ...           a year ago
  • 1.0.22                                ...           a year ago
  • 1.0.21                                ...           a year ago
  • 1.0.20                                ...           a year ago
  • 1.0.18                                ...           a year ago
  • 1.0.17                                ...           a year ago
  • 1.0.16                                ...           a year ago
  • 1.0.15                                ...           a year ago
  • 1.0.13                                ...           a year ago
  • 1.0.12                                ...           a year ago
  • 1.0.11                                ...           a year ago
  • 1.0.10                                ...           a year ago
  • 1.0.9                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 1
Dependencies (5)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |