应用程序的可执行文件名称是否可以与应用程序的显示名称不同?

huangapple go评论151阅读模式
英文:

Can the app's executable filename be different from the app's display name?

问题

I am sure it was possible at least till lately to have the app's executable (the .app) filename different from the app's product name / display name.

Our app's name is in Chinese however until recently its executable filename was in English, say abc.app. I inherited this setup several years ago. Recently though we looked into changing the app's Chinese name (to another Chinese name) but decided eventually not to do so. However, since the attempt to change the app's name I have not been able to get the executable filename to be in English. No matter what it always is the same as the PRODUCT_NAME, which is in Chinese. I tried modifying the app's 'bundle name', 'bundle display name', 'executable file' and other settings. None worked.

By the way, the reason we want the executable's filename to be in English is: some of the code will have to be modified otherwise. For example the following statement will not work when [[NSBundle mainBundle] resourcePath] contains non-English characters:

NSURL* url = [NSURL URLWithString:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:urlStr]];

英文:

I am sure it was possible at least till lately to have the app's executable (the .app) filename different from the app's product name / display name.

Our app's name is in Chinese however until recently its executable filename was in English, say abc.app. I inherited this setup several years ago. Recently though we looked into changing the app's Chinese name (to another Chinese name) but decided eventually not to do so. However, since the attempt to change the app's name I have not been able to get the executable filename to be in English. No matter what it always is the same as the PRODUCT_NAME, which is in Chinese. I tried modifying the app's 'bundle name', 'bundle display name', 'executable file' and other settings. None worked.

By the way, the reason we want the executable's filename to be in English is: some of the code will have to be modified otherwise. For example the following statement will not work when [[NSBundle mainBundle] resourcePath] contains non-English characters:

> NSURL* url = [NSURL URLWithString:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:urlStr]];

答案1

得分: 0

Credit goes to @Cy-4AH, 这是一个正确的答案:

> 只需在 plist 中添加自定义文本,用于 CFBundleDisplayName。将 PRODUCT_NAME 和 target name 保留为英文。

英文:

Credit goes to @Cy-4AH, this is a correct answer:

> Just add custom text in plist for CFBundleDisplayName. PRODUCT_NAME
> and target name leave in english.

huangapple
  • 本文由 发表于 2020年1月4日 01:07:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/59582543.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定