只使用pod的同學(xué)搜一下"ERROR ITMS-90060: "This bundle is invalid. The value for key CFBundleShortVersionString 'adaff276015b8322fa5d2060e265940acf01c8e7' in the Info.plist file must be a period-separated list of at most three non-negative integers.""中的adaff276015b8322fa5d2060e265940acf01c8e7,改成Int.Int.Int的格式就行.
使用carthage的同學(xué),恭喜你, 成功節(jié)省了時間
某些第三方庫的作者會在Build Phases里加個配置, 修改info.plist中內(nèi)容, 比如下圖
如果你想給你的同事挖坑的話就這么干, info.plist中的版本號必須為以小數(shù)點(diǎn)分隔的整數(shù), 如果是上圖中的git版本號, 你的同事打包的時候完全不知道info.plist出了什么問題, 整個電腦都搜不到這個版本號...
附上shell代碼
git=$(sh /etc/profile; which git)
git_release_version=$("$git" describe --tags --always --abbrev=0)
number_of_commits=$("$git" rev-list master --count)
target_plist="$TARGET_BUILD_DIR/$INFOPLIST_PATH"
dsym_plist="$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME/Contents/Info.plist"
for plist in "$target_plist" "$dsym_plist"; do
if [ -f "$plist" ]; then
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $number_of_commits" "$plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${git_release_version#*v}" "$plist"
fi
done
上面粗體部分就是第三方庫作者挖的坑, git_release_version加后面的運(yùn)算符得到的肯定不是整數(shù), 比如我得到的是adaff276015b8322fa5d2060e265940acf01c8e7,呵呵,腦門子都要摳爛了都不知道哪出了問題