forked from imharryzhu/AndroidControl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.js
More file actions
44 lines (33 loc) · 708 Bytes
/
Copy pathinit.js
File metadata and controls
44 lines (33 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* Common functions
*/
/**
* Sleep In Java Thread
* @param millisecond
*/
function sleep(millisecond) {
java.lang.Thread.sleep(millisecond);
}
/**
* 获取已安装包名
* @param device
* @returns {*}
*/
function getPKGList(device) {
return device.executeShellAndGetString("pm list packages");
}
var device = com.yeetor.engine.EngineDevice.getDevice("3HX5T16C17040892");
function 画圆() {
device.touchDown(540, 0);
var r = 450;
for (var i = 0; i < 360; i++) {
var y = Math.cos(i) * r;
var x = Math.sin(i) * r;
x += 540;
y += 960;
print(x + ":" + y);
device.touchMove(x, y);
}
device.touchUp();
}
画圆();