![](/img/trans.png)
[英]Xcode 7 error: could not read CFBundleIdentifier from Info.plist (null)
[英]Is there a way to refer to the CFBundleIdentifier elsewhere in the Info.plist file?
對於我們的游戲,在Info.plist文件中,我們的CFBundleIdentifier
設置為
<key>CFBundleIdentifier</key>
<string>com.sixminute.$(PRODUCT_NAME:rfc1034identifier)</string>
但是,對於Google Play登錄,我們需要CFBundleURLTypes
的以下URL類型,
<key>CFBundleURLName</key>
<string>com.sixminute.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.sixminute.$(PRODUCT_NAME:rfc1034identifier)</string>
</array>
有什么方法可以代替$(BUNDLE_IDENTIFIER)
或類似的方法動態引用CFBundleIdentifier
?
您可以按照以下步驟在目標屬性的XCode中定義用戶變量:
然后在您的plist文件中,您可以簡單地使用:
<key>CFBundleIdentifier</key>
<string>${BundleId}</string>
您不能稍后(或以編程方式)動態更新CFBundleIdentifier,而只能向其編譯時添加值。 如果您要引用其他內容,您的問題也不清楚。
BTW,CFBundleIdentifier和CFBundleURLName / CFBundleURLSchemes完全正交。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.