由于旧的打包平台自动生成的plist文件中的bundle-identifier
值为空值,并且assets
中没有含有display-image
以及full-size-image
的dict,所以不能成功的安装到设备上.
plist样例文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>https://app/example.ipa</string>
</dict>
<dict>
<key>kind</key>
<string>display-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<string>https://icon/example57.png</string>
</dict>
<dict>
<key>kind</key>
<string>full-size-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<string>https://icon/example512.png</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>com.example.id</string>
<key>bundle-version</key>
<string>1.0.0</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>AppNameExample</string>
</dict>
</dict>
</array>
</dict>
</plist>
因为是纯脚本操作,所以碰到了一个坑.那就是往bundle-identifier的下一行<string></string>
中间插入需要的值.然而,找到对应的行之后想使用sed -i
来操作发现原字符串不能为空…然后使用了Apple自带的/usr/libexec/PlistBuddy
工具去操作plist.最后传了上去.
plist文件的地址.
这里又有一个坑.plist文件的地址必须为https的.不然就无法进行安装,请求了网址之后会告诉你
无法安装应用程序,因为"xxx"的证书无效.