区分iPhone应用程序的开发版本

发布于 2024-09-08 16:39:34 字数 198 浏览 5 评论 0原文

我喜欢在手机上保留商店购买的 iPhone 应用程序版本,以便我可以重现出现的任何客户问题,但我显然也想运行最新的开发版本。我可以安装两者(一种来自 iTunes,一种来自 xCode),但我对如何更好地区分两者感兴趣。我可以暂时更改名称或图标,但这似乎不太安全,即我可能会忘记并使用错误的图标发送它。

有没有一种快乐的乐趣开发者方式来做到这一点?

I like to keep a store-bought version of my iPhone apps on my phone so that I can reproduce any customer issues that come up, but I obviously also want to run the most current development version. I can install both (one from iTunes, one from xCode) but I'm interested in ways that I'm better able to tell the two apart. I could just change the name or icon temporarily, but that doesn't seem very failsafe, i.e. I might forget and ship it with the wrong icon.

Is there a happy funtime developer way to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

泛泛之交 2024-09-15 16:39:34

我受到 Eric 向项目添加用户定义设置的想法的启发,但我不想每次构建项目时都运行脚本。

我们知道iPhone默认会查找名为“Icon.png”的图标文件。事实证明,如果您正确命名了图标,则根本不需要项目 plist 中的“图标文件”设置。但是,如果项目中没有名为“Icon.png”的文件,xCode 会查看“Icon File”设置的值。

我在“调试”中将名为“Icon_Name”的用户定义设置设置为非标准图标名称,“DevIcon.png”和“Release”配置的“ReleaseIcon.png”。项目 plist 中的“图标文件”设置现在可以设置为 ${ICON_NAME} 并将采用我们正在使用的任何配置文件的值。现在在两种不同的配置下构建确实使用两个不同的图标。

编辑:对于多个图标(高分辨率、小图标、ipad 等),我采取了略有不同的方法。用户定义的设置现在是“IconPrepend”,其中“Dev”用于调试,“Release”用于发布配置。我现在在信息 plist 中使用“图标文件”(而不是“图标文件”),它采用字符串数组。每个字符串前面都带有 ${ICONPREPEND} ,以便调试配置查找“DevIcon.png”或“[email protected]”并发布配置查找“ReleaseIcon.png”或“[电子邮件受保护]"。

I was inspired by Eric's idea of adding a user-defined setting to the project but I didn't want to run a script every time I built the project.

We know that the iPhone looks for icon files named "Icon.png" by default. It turns out that the "Icon File" setting in the project plist isn't necessary at all if you've named your icon properly. However, if there is no file named "Icon.png" in the project, xCode looks at the value of the "Icon File" setting.

I set a user-defined setting in "Debug" called "Icon_Name" to a non-standard icon name, "DevIcon.png" and "ReleaseIcon.png" for the "Release" config. The "Icon File" setting in the project plist can now be set to ${ICON_NAME} and will take on the value of whatever config file we're using. Now building under two different configurations does use two different icons.

Edit: For multiple icons (high res, small, ipad, etc) I made a slightly different approach. The user-defined setting is now "IconPrepend" which is "Dev" for debug and "Release" for release config. I'm now using "Icon Files" (rather than "Icon File") in the info plist which takes an array of strings. Each string is prepended with ${ICONPREPEND} so that debug configurations look for "DevIcon.png" or "[email protected]" and release configurations look for "ReleaseIcon.png" or "[email protected]".

残疾 2024-09-15 16:39:34

这里有一个想法 - 如果您在项目构建属性中仅按照 USE_DEV_ICON=YES (或其他)的方式设置“调试”的用户定义设置。然后,使用构建目标中的“运行脚本”选项,您可以根据您调用的活动配置复制不同的图标。

类似于(伪代码)的内容:

if ($USE_DEV_ICON == YES)
    cp DevIcon.png Icon.png
else
    cp RealIcon.png Icon.png

然后每次构建时,根据活动配置,它都会复制正确的图标。

Here's an idea - if you set a User-Defined Setting in your Project Build properties for Debug only along the lines of USE_DEV_ICON=YES (or something). Then, using the "Run Script" option in your Build Target you could copy different icons based on which Active Configuration you called.

Something along the lines of (pseudo-code):

if ($USE_DEV_ICON == YES)
    cp DevIcon.png Icon.png
else
    cp RealIcon.png Icon.png

Then every time you build, depending on the active configuration, it will copy the correct icon.

oО清风挽发oО 2024-09-15 16:39:34

很可能没有其他办法。您的应用商店版本和开发版本与操作系统完全不同。如果要区分,需要更改图标或名称。您还可以在开发版本中包含一些调试标签(例如版本号),但您也可能忘记删除它。

Most probably there is no other way. Your app store version and development version is completely different to the OS. If you want to distinguish, you need to change the icon or name. You can also include some debugging label (e.g. version number) in your development version, but you may also forget to remove this.

柏拉图鍀咏恒 2024-09-15 16:39:34

也许你会买第二部 iPhone?严重地。站在你的立场上,我会问同样的问题,但我肯定会考虑这样的解决方案。如果我是一名 iPhone(或任何其他特定平台)开发人员,我很可能拥有不止一个。

Maybe you'd just buy a second iPhone? Seriously. On your place I'd ask the same question as you do, but I will definitely take such a solution in mind. If I was an iPhone (or whatever other specific platform) developer, I'd most probably have more than one.

℉絮湮 2024-09-15 16:39:34

难道您不能在 Info.plist 文件中创建一个具有不同 Bundle 名称的新目标,并在您想要构建在 iPhone 上运行的应用程序时使用此目标吗?

Couldn't you make a new target which has a different Bundle name in the Info.plist file, and use this target whenever you want to build the app to run on your iPhone?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文