1.1.55 • Published 6 years ago
bat-api v1.1.55
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
1.1.55
6 years ago
1.1.53
6 years ago
1.1.52
6 years ago
1.1.51
6 years ago
1.1.50
6 years ago
1.1.36
6 years ago
1.1.33
6 years ago
1.1.32
6 years ago
1.1.31
6 years ago
1.1.30
6 years ago
1.1.8
6 years ago
1.1.6
6 years ago
1.1.3
6 years ago
1.1.2
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.62
6 years ago
1.0.61
6 years ago
1.0.60
6 years ago
1.0.52
7 years ago
1.0.51
7 years ago
1.0.50
7 years ago
1.0.33
7 years ago
1.0.32
7 years ago
1.0.30
7 years ago
1.0.27
7 years ago
1.0.26
7 years ago
1.0.25
7 years ago
1.0.22
7 years ago
1.0.21
7 years ago
1.0.20
7 years ago
1.0.18
7 years ago
1.0.17
7 years ago
1.0.16
7 years ago
1.0.15
7 years ago
1.0.13
7 years ago
1.0.12
7 years ago
1.0.11
7 years ago
1.0.10
7 years ago
1.0.9
7 years ago
1.0.6
7 years ago
1.0.5
7 years ago
1.0.3
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago