swipeForDevice instead of device.shell()
This commit is contained in:
@@ -167,9 +167,10 @@ class CommandorPage {
|
||||
for (let i = 1; i <= limit; i++) {
|
||||
let x = 350 + getRandom() * 100
|
||||
let y0 = 600 + getRandom() * 100 + getRandom() * 10 + getRandom() * 1
|
||||
let swipCmd = "input swipe " + x + " " + y0 + " " + x + " 1522"
|
||||
logWithDevice("will send cmd:" + swipCmd, this.device)
|
||||
await this.device.shell(swipCmd);
|
||||
// let swipCmd = "input swipe " + x + " " + y0 + " " + x + " 1522"
|
||||
// logWithDevice("will send cmd:" + swipCmd, this.device)
|
||||
await this.swipeForDevice(this.device, x, y0, x, 1522)
|
||||
// await this.device.shell(swipCmd);
|
||||
await delay(3 * getRandomWaitTime());
|
||||
}
|
||||
// await this.openGoogle()
|
||||
@@ -1200,6 +1201,13 @@ class CommandorPage {
|
||||
await exec(cmd);
|
||||
}
|
||||
|
||||
async swipeForDevice(device, x0, y0, x1, y1) {
|
||||
// let swipCmd = "input swipe " + x + " " + y0 + " " + x + " 1522"
|
||||
let cmd = `adb -s ${device.serial()} shell input swipe ${x0} ${y0} ${x1} ${y1}`
|
||||
logWithDevice("cmd is " + cmd, this.device)
|
||||
await exec(cmd);
|
||||
}
|
||||
|
||||
async inputForDevice(device, text) {
|
||||
let cmd = `adb -s ${device.serial()} shell input text ${text}`
|
||||
logWithDevice("cmd is " + cmd, this.device)
|
||||
|
||||
Reference in New Issue
Block a user