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)
Device.searchObject(sigmaConst.DevGroup, GroupName)
原型:
Device.searchObject(sigmaConst.DevGroup, GroupName)
对应的 REST API:
描述:
根据给定的组名称获取组内所有设备的对象集合
通过返回的设备对象集合可以对集合中的所有设备进行批量控制操作
参数:
DevGroup: 常量值,sigmaConst.DevGroup
GroupName: 字符串,组名称
返回值:
成功: 设备对象集合
失败: null
异常: lastError()
示例:
打开group1组所有设备的相机。
// 定义要运行的app名字 var runAppName="com.huawei.camera" //获取在组 "group1" 中的所有设备的对象集合 var devices = Device.searchObject(sigmaConst.DevGroup, "group 1"); //如果没有获取到设备,就输出”没有找到设备” if(!devices) { print("没有找到设备"); } else { devices.runApp(runAppName);//打开手机相机 }