ios-sim Invalid binary plist. Expected 'bplist' at offset 0.记录

时间:2015-11-16

地点:无

人物:lieyunye

起因

        提交Facebook审核时

ios-sim Invalid binary plist. Expected 'bplist' at offset 0.记录_第1张图片

经过:

Create a Simulator Build

安装npm, ios-sim

在第三步Verify Build时

打开ios-sim源码

ios-sim Invalid binary plist. Expected 'bplist' at offset 0.记录_第2张图片

在lib.js中找到launch方法

ios-sim Invalid binary plist. Expected 'bplist' at offset 0.记录_第3张图片

可以看出是在执行bplist.parseFile 抛出的异常

那么bplist是个啥

这个过程中又出现

npm WARN ENOENT ENOENT: no such file or directory, open '/Users/xxx/Library/Developer/Xcode/DerivedData/skitlyworkspace-guizuthqghijhafekfpzbmielulk/Build/Products/Debug-iphonesimulator/package.json'

npm WARN EPACKAGEJSON /Users/xxx/Library/Developer/Xcode/DerivedData/skitlyworkspace-guizuthqghijhafekfpzbmielulk/Build/Products/Debug-iphonesimulator No description

npm WARN EPACKAGEJSON /Users/xxx/Library/Developer/Xcode/DerivedData/skitlyworkspace-guizuthqghijhafekfpzbmielulk/Build/Products/Debug-iphonesimulator No repository field.

npm WARN EPACKAGEJSON /Users/xxx/Library/Developer/Xcode/DerivedData/skitlyworkspace-guizuthqghijhafekfpzbmielulk/Build/Products/Debug-iphonesimulator No README data 

npm WARN EPACKAGEJSON /Users/xxx/Library/Developer/Xcode/DerivedData/skitlyworkspace-guizuthqghijhafekfpzbmielulk/Build/Products/Debug-iphonesimulator No license field.

解决办法:sudo npm install -g bplist

再次执行:ios-sim launch skitly.app --devicetypeid iPhone-5s, 9.1,问题依旧存在Invalid binary plist. Expected 'bplist' at offset 0.

打开bplist源码

ios-sim Invalid binary plist. Expected 'bplist' at offset 0.记录_第4张图片

找到异常抛出的代码

ios-sim Invalid binary plist. Expected 'bplist' at offset 0.记录_第5张图片

解析时没有bplist,但是plist文件是存在的,打开Info.plist:

依旧是xml格式,应该转为binary格式才行

Convert Property List (plist) Between Binary and XML Formats

执行plutil -convert binary1 Info.plist

打开Info.plist:

ios-sim Invalid binary plist. Expected 'bplist' at offset 0.记录_第6张图片

结果:

执行ios-sim launch skitly.app --devicetypeid iPhone-5s, 9.1 成功的在模拟器中运行

你可能感兴趣的:(ios-sim Invalid binary plist. Expected 'bplist' at offset 0.记录)