Modifying Info.plist's CFBundleVersion in Xcode 5 with Asset Library enabled

ⅰ亾dé卋堺 提交于 2019-11-30 11:36:13

I had similar issue once, and here is what finally helped me out:

buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${INFOPLIST_FILE}")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${INFOPLIST_FILE}"

(Use INFOPLIST_FILE directly, not $BUILT_PRODUCTS_DIR/$INFOPLIST_PATH)

Hope this could be useful .

Figured this one out, and it was a silly one. Turns out you can just move the script phase to the very end. I didn't even know these were movable, or that it mattered! But by dragging the Run Script phase to the bottom as such, the scripts were able to run and modify things as needed.

I had the same problem, In my case, I had a wrong file path to the XXX-Info.plist file:

Build Settings -> Packaging -> Info.plist File

I changed it it's actual location and start working.

If your plist file is Preprocessed-Info.plist, then change the value of "Preprocess Info.plist File" (INFOPLIST_PREPROCESS) to "Yes" (true) like this:

Search in Build settings for $(SRCROOT) and remove it.

transform it from $(SRCROOT)/TestProject/Info.plist to TestProject/Info.plist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!