Script 1.8.1
- 脚本语言
- 设备对象获取
- Device.getMain
- Device.searchObject(<DeviceName>)
- Device.searchObject(sigmaConst.DevAll)
- Device.searchObject(sigmaConst.DevGroup, <GroupName>)
- Device.searchObject(sigmaConst.DevSerial,<Serial>)
- Device.searchObject(sigmaConst.DevSelectOne)
- Device.searchObject(sigmaConst.DevSelectMult)
- Device.searchObject(sigmaConst.DevSelectGroup)
- 设备属性值
- 设备控制接口说明
- 公共接口说明
- 快捷键定义接口
- MTE说明
- getPixelColor
- getPixelColorStr
- runCTest
- runDTest
- setMessage(对象成员函数)
- setMessage(非对象成员函数)
- setStatus(对象成员函数)
- setStatus(非对象成员函数)
- stop(对象成员函数)
- Testrun(对象成员函数)
- Color
- setName
- Coord
- ImageInfo
- define
- lastError
- readExcel
- scriptKill
- scriptKillAll
- scriptList
- getLanguage
- scriptRun
- sigmaLoad
- screenshot
- seekColor
- seekImage
- seekImageByID
- send
- sendMessage
- setName
- setVolumes
- shift
- runApp
- swipe(coordArray)
- upload(fpath,tpath,timeout)
- unlock
- sleep()
- uninstallAPK(packageName)
- wakeup()
- deleteListener
- getNotification
- Notification
- reset
- swipe
- uninstallAPK
- unlock
- upload
- uploadTessData
- wakeup
- writeFile
- sleep
- click(x,y)
- closeApp(packageName)
- download(fpath,tpath,timeout)
- inputText(text)
- installAPK(apkPath)
- lock(timeout)
- runApp(packageName)
- screenShot(path,imageType,tx,ty,bx,by)
- send(key)
- exit
- execCommand
- execCommand
- fileBinaryReader
- fileTextReader
- delay
- getSDPath
- getSetting
- getTextByBaiduCloudOnAndroid
- setVolumes(type,volume)
- shift(type)
- sendMessage(phone,message)
使用消息启动应用.js
代码:
/* * version : 6.2.0.2886 * resolution : 720*1280 * description : 通过聊天软件发送应用名称,打开对应的应用 */ define("version", "6.2.0.2886"); define("resolution", "720*1280"); define("requireVersion", "1.5.0.2865"); //打印出消息是哪个app发送,和消息内容,并根据消息内容启动应用 function runApp(dev, app, text) { //打印出是哪个app发送的信息 print(app) //打印出具体的消息内容 print(text) //根据收到的信息特点处理信息,以获取有效内容 var textToArray = text.split(': ') print(textToArray[1]); //根据消息内容启动对应的应用 if(textToArray[1]=="设置"){ dev.runApp("com.android.settings"); } if(textToArray[1]=="相机"){ dev.runApp("com.android.camera"); } if(textToArray[1]=="联系人"){ dev.runApp("com.android.contacts"); } if(textToArray[1]=="短信"){ dev.runApp("com.android.mms"); } } var device = Device.searchObject(sigmaConst.DevSelectOne); //设置消息内容为'相机'的消息过滤 var notification = new Notification(device, sigmaConst.Any,sigmaConst.Any); //设置监听器,当收到对应消息是会启动对应的回调函数,启动相应的应用 notification.setListener(runApp);