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