Added getTexts and action recorder, fixed github issue report token
This commit is contained in:
@@ -25,6 +25,18 @@
|
||||
* `notStopped` 若当前脚本处于运行状态时返回`true`, 否则返回`false`。对于某些循环, 例如`while(true)`,请用`while(notStopped())`代替,以免死循环造成的脚本无法正常停止。
|
||||
* `isStoppd` 若当前脚本处于停止状态时返回`true`, 否则返回`false`。
|
||||
* `shell(cmd, root=false)` 执行shell命令cmd, 其中参数root表示是否以root权限执行,默认为false。例如`shell("input keyevent 26", true); //锁屏`。
|
||||
* `getTexts()` 获取屏幕上的文字列表, 返回一个java.util.List<String>。例如:
|
||||
|
||||
```
|
||||
launchApp("微信");
|
||||
while(!click("通讯录"));
|
||||
var texts = getTexts();
|
||||
for(var i = 0; i < texts.size(); i++){
|
||||
log(texts.get(i));
|
||||
}
|
||||
openConsole();
|
||||
```
|
||||
|
||||
###四、全局变量
|
||||
* `context` ApplicationContext,参见安卓[android.content.Context](https://developer.android.com/reference/android/content/Context.html)
|
||||
> 这里的context由于是ApplicationContext,是不可见的,不能用于dialog和其他UI相关。如果要显示弹窗或者视图,请启动UI模式(代码的第一行为`"ui";`既可)并使用activity代替。
|
||||
|
||||
Reference in New Issue
Block a user