一个 Xcode 4 项目,四个目标“变体” ...有一个转折
我偷偷怀疑我想要做的事情可以在 Xcode 4 中更优雅地完成……但我以前就错了。独家新闻如下:
我有一个 iOS 应用程序,具有通常的调试/发布版本以及常规、单元测试和 ui 测试目标。那里没有什么不寻常的。该应用程序还会调用服务器。那里也没什么特别的。除了......
现在我希望能够为四种不同的服务器环境构建应用程序:开发、QA、UAT/Beta 和生产。此外,每个构建必须能够在同一设备上共存,以供开发人员构建或临时分发。
那么让我们看看……结果会如何?对于初学者来说,每个应用程序都需要自己的目标标识符。也许检测构建类型可以帮助确定要使用的服务器:
调试构建目标开发。 (临时分发)版本构建目标 QA(...或 UAT/Beta?)。 (App Store 分发)发布版本构建目标生产。
至于那些目标标识符(com.companyname.appname),我想我可以为每个构建使用不同的 Info.plist 文件......但这闻起来很笨拙(重复信息)。也许这是唯一的方法?
底线:我不确定 a) 如何解决 Ad Hoc 与 App Store 分发案例,以及 b) QA/UAT 案例,以及 c) 如何在不搞乱(至少对我来说)Xcode 4 提供了更优雅的设置以及那些简单的“按播放”调试/发布构建操作。
也许我必须添加新方案?也许这只是添加更多 Info.plist 文件...或构建...或配置...或目标...或某种混合的问题。再次强调,如果可以的话,我会尽量避免重复大量信息(仅更改一两个设置)。调试/发布看起来非常干净,我想确保我沿着正确的轴更改内容。正如他们所说,测量两次,切割一次。
欢迎提供线索/赞赏!
I have a sneaking suspicion that what I'm looking to do can be done more elegantly within Xcode 4 ... but then I've been wrong before. Here's the scoop:
I have an iOS app with the usual debug/release builds and regular, unit-test, and ui-test targets. Nothing unusual there. The app also calls out to a server. Nothing special there either. Except ...
Now I want to be able to build the app for four different server environments: Development, QA, UAT/Beta, and Production. In addition, each build must be able to co-exist on the same device, for developer builds or ad hoc distribution.
So let's see ... how might this pan out? Each app will need its own target identifier for starters. Perhaps detecting the kind of build could help target which server to use:
Debug builds target Development.
(Ad Hoc Distribution) Release builds target QA (... or UAT/Beta?).
(App Store Distribution) Release builds target Production.
As for those Target Identifiers (com.companyname.appname), I suppose I could use different Info.plist files for each build ... but that smells unwieldy (duplicate info). Perhaps it's the only way?
Bottom line: I'm uncertain of a) how to resolve the Ad Hoc vs. App Store Distribution cases, as well as b) the QA/UAT cases, as well as c) how to do this without messing up the (at least to me) more elegant setup Xcode 4 offers with those simple "Press Play" Debug/Release build ops.
Maybe I have to add new Schemes? Perhaps it's simply a matter of adding more Info.plist files ... or builds ... or configurations ... or targets ... or some mixture. Again, I'm trying to keep from duplicating a lot of info (only to change one or two settings) if I can help it. Debug/Release seems very clean as it is, and I want to make sure I change things along the proper axis. Measure twice, cut once, as they say.
Clues welcome/appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是我最终所做的。希望这是最明智的方法:
我想这会成功的!但是,如果有更干净的方法,请权衡。谢谢!
Here's what I ended up doing. Hopefully this is the most sensible way to go about it:
I think this will do the trick! If there's a cleaner way, however, please weigh in. Thanks!