- 脚本语言
- 设备对象获取
- 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)
getSetting
原型:
getSetting(sigmaConst.DisplayMode)
getSetting(sigmaConst.DisplayQuality)
getSetting(sigmaConst.DisplayAccl)
getSetting(sigmaConst.DisplayHWDecode)
getSetting(sigmaConst.DisplayResolutionMode)
getSetting(sigmaConst.DisplayOrientation)
getSetting(sigmaConst.DisplayResolution)
是否支持多设备:
不支持
描述:
获取手机的指定属性
参数:
sigmaConst.DisplayMode:获取手机的显示模式,对应的返回值为:
1 – 表示显示模式是HA1;
2 – 表示显示模式是HA2;
3 – 表示显示模式是Comp;sigmaConst.DisplayQuality: 获取手机的显示质量,对应的返回值为:
1 – High
2 – Medium
3-LowsigmaConst.DisplayAccl: 获取手机的加速模式,对应的返回值为:
1 – GDI
2 – DirectX
3 - OpenGLsigmaConst.DisplayHWDecode: 显示时是否使用硬件解码,对应的返回值为:
1 – Yes
0 – NosigmaConst.DisplayResolutionMode: 显示分辨率模式,对应的返回值为:
1 - 480p,
2 - 640p,
3 - 720p,
4 - 1080psigmaConst.DisplayOrientation: 显示方向,对应的返回值为:
1 – Portrait; (竖屏)
2 – Landscape;(横屏)sigmaConst.DisplayResolution: 以对象方式返回屏幕的宽和高。
例如:{h: 1920, w:1080}
返回值:
字符串:根据不同的参数返回对应的手机设置。
成功返回解析得到的字符串,失败返回空字符串。
示例:
//获取当前主控设备对象 var device = Device.getMain(); if(!device) { print("没有找到设备"); } else { //获取手机的显示模式 ret = device.getSetting(sigmaConst.DisplayMode); print("手机的显示模式:"+ret); //获取手机的显示质量 ret = device.getSetting(sigmaConst.DisplayQuality); print("手机的显示质量:"+ret); //获取手机的加速模式 ret = device.getSetting(sigmaConst.DisplayAccl); print("手机的加速模式:"+ret); //显示时是否使用硬件解码 ret = device.getSetting(sigmaConst.DisplayHWDecode); print("显示时是否使用硬件解码:"+ret); //显示分辨率模式 ret = device.getSetting(sigmaConst.DisplayResolutionMode); print("显示分辨率模式:"+ret); //显示方向 ret = device.getSetting(sigmaConst.DisplayOrientation); print("显示方向:"+ret); //获取屏幕的宽和高 var data = device.getSetting(sigmaConst.DisplayResolution); print("屏幕的宽和高为:"+data.w + "/" + data.h); }
运行结果:
手机的显示模式:1 手机的显示质量:2 手机的加速模式:2 显示时是否使用硬件解码:1 显示分辨率模式:2 显示方向1 屏幕的宽和高为:720/1280