How to read plist information (bundle id) from a shell script

前端 未结 5 1593
慢半拍i
慢半拍i 2020-12-14 07:29

I\'d like to write a script that can read info like Bundle Identifier or maybe version number from the Info.plist of the app. Xcode doesn\'t seem to give that information in

5条回答
  •  Happy的楠姐
    2020-12-14 07:56

    You can just read the file directly from the built product. However, if you look at the info.plist file itself in the editor you will see the shell variables themselves. E.g. the Bundle ID is has the following shell command:

    com.yourcompany.${PRODUCT_NAME:rfc1034identifier}
    

    You can call ${PRODUCT_NAME:rfc1034identifier} in any shell script that Xcode runs and it should populate.

提交回复
热议问题