代码改变世界

iphone设备在stf平台不展示,报错string: undefined (not a string) at Field

2021-08-11 14:16  Tanwheey  阅读(219)  评论(0编辑  收藏  举报

throw Error("Illegal value for " + this.toString(true) + " of type " + this.type.name + ": " + val + " (" + msg + ")");

  因为没有该设备, "iPhone12,8": "iPhone SE" 添加到 DeviceType  中即可。

 

2021-08-11T05:34:09.844Z INF/ios-device 5738 [00008030-001278DC21E3802E] Fully operational

stf/node_modules/protobufjs/dist/ProtoBuf.js:2641 throw Error("Illegal value for "+this.toString(true)+" of type "+this.type.name+": "+val+" ("+msg+")"); ^ Error: Illegal value for Message.Field .DeviceIdentityMessage.model of type string: undefined (not a string) at Field. (stf/node_modules/protobufjs/dist/ProtoBuf.js:2641:27) at ...

 

原因:获取不到this.type.name,因为设备没有在lib/units/ios-device/support/TypeToModel.js中维护导致,添加设备即可。

已有设备记录:

DeviceType = {
"iPhone6,1": "iPhone 5s"
, "iPhone6,2": "iPhone 5s"
, "iPhone7,2": "iPhone 6"
, "iPhone7,1": "iPhone 6 Plus"
, "iPhone8,1": "iPhone 6s"
, "iPhone8,2": "iPhone 6s Plus"
, "iPhone8,4": "iPhone SE"
, "iPhone9,1": "iPhone 7"
, "iPhone9,3": "iPhone 7"
, "iPhone9,2": "iPhone 7 Plus"
, "iPhone9,4": "iPhone 7 Plus"
, "iPhone10,1": "iPhone 8"
, "iPhone10,4": "iPhone 8"
, "iPhone10,2": "iPhone 8 Plus"
, "iPhone10,5": "iPhone 8 Plus"
, "iPhone10,3": "iPhone X"
, "iPhone10,6": "iPhone X"
, "iPhone11,8": "iPhone XR"
, "iPhone11,2": "iPhone XS"
, "iPhone11,6": "iPhone XS Max"
, "iPhone11,4": "iPhone XS Max"
, "iPad6,11": "iPad air 2"
, "iPhone13,2": "iPhone 12"
, "iPhone12,8": "iPhone SE"
}