Xcode - 更改包标识符但不更改产品名称 [英] Xcode - change bundle identifier but not product name

查看:32
本文介绍了Xcode - 更改包标识符但不更改产品名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的包标识符必须与 iOS 开发门户中的标识符一致:

My bundle identifier has to match the one in the iOS dev portal:

com.mydomain.myappname

com.mydomain.myappname

似乎在 Xcode 中执行此操作的唯一方法是转到目标、构建设置,并将产品名称更改为 myappname.但是,这也会导致应用在设备主屏幕上(在图标下)被称为myappname".我知道必须能够以不同的方式设置.(我希望显示我的应用程序"而不是我的应用程序名称").我在哪里设置?

It seems the only way to do this in Xcode is to go to Targets, Build Settings, and change the Product Name to myappname. However, this also causes the app to be called "myappname" on the device home screen (under the icon). I know that has to able to be set differently. (I want "My App" to be displayed instead of "myappname"). Where do I set this?

推荐答案

您在 Xcode 的构建设置中将其设置为产品名称".您想在 info.plist 文件中为您的应用设置您的包标识符.

You set this as the "Product Name" in the Build Settings in Xcode. You want to set your bundle identifier in the info.plist file for your app.

Info.plist 中的包标识符可以包含占位符变量,例如 ${PRODUCT_NAME}.编译应用程序时,这些占位符变量将替换为来自构建设置的值.使用 plutil 查看 .app 包中 Info.plist 的编译版本.

The bundle identifier in the Info.plist can contain placeholder variables such as ${PRODUCT_NAME}. These placeholder variables are replaced with their values from the build settings when the app is compiled. Use plutil to see the compiled version of the Info.plist in your .app bundle.

这篇关于Xcode - 更改包标识符但不更改产品名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆