如何管理构建 iPhone 应用程序的精简版与付费版?

发布于 2024-07-13 20:19:02 字数 524 浏览 10 评论 0 原文

我开始考虑建立一个 我的 iPhone 应用程序的精简版。 我在网上发现了一些能说话的东西 有关该过程的一些信息,即:

http://developer.apple.com/tools/XCode /XCodeprojects.html

http://www.pacificspirit.com/blog /2009/01/27/building_for_multiple_iphone_targets_in_xcode

我是什么 特别感兴趣的是简化管理过程 我的应用程序的不同版本中包含哪些文件 不断修改和增强我的付费版本。

I'm starting to get to the point where I want to consider building a
lite version of my iPhone app. I've found a few things on the web that talk
about the process a bit, namely:

http://developer.apple.com/tools/XCode/XCodeprojects.html

http://www.pacificspirit.com/blog/2009/01/27/building_for_multiple_iphone_targets_in_xcode

What I'm
specifically interested in is simplifying the process of managing
which files are included in the different versions of my app as I
continually modify and enhance my paid for version.

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

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

发布评论

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

评论(6

凶凌 2024-07-20 20:19:02

最初的答案来自应用程序购买前几天。 现在正确的答案是发送单个二进制文件,并通过应用内升级。 代码稍微多一些,但它是一次发货,您的转化率可能会更好。

但是,如果您仍然想要应用程序的版本:

Xcode 对多个目标有很好的支持。

从项目菜单中选择“新目标...”。 添加另一个 iPhone 可执行文件(Cocoa Touch 应用程序),然后您可以按资源指定目标中包含哪些项目。 这可以包括仅将某些代码编译到您的付费版本中。

通过右键单击“组和文件”列表标题(顶部左侧)并启用目标成员资格,您可以获得有关当前目标中包含和未包含的内容的快速视觉反馈。

您可以按照在 Simulator 或 iPhone 构建之间切换的相同方式在构建不同目标之间进行切换。

要在构建时指定特定类的行为方式,您可以做两件事 - 包含该类的两个版本,每个版本都是为其各自的目标构建的,或者您可以为预处理器设置构建时标志。 在“组和文件”列表中选择目标,然后“获取该目标的信息”。 转到构建选项卡并搜索“预处理”。 您应该会看到一个名为“预处理器宏”的项目,将 LITE 添加到您的精简版目标,并以相同的方式将 PAID 添加到您的付费目标。

在源文件中,您可以在编译时确定要使用 #ifdef LITE 等编译哪个版本。

更进一步,您可以基于 #ifdef LITE 设置全局标志或 AppDelegate 成员变量,并更改 Lite 和付费应用程序在运行时的行为。 但我不确定我是否看到了其中的价值。

Original answer is from the days before in app purchase. The correct answer now is to ship a single binary and offer your paid version through in app upgrades. It's slightly more code but it's a single shipment and your conversion rate will probably be better.

However, if you still want to versions of your app:

Xcode has good support for multiple targets.

From the project menu select "New Target...". Add another iPhone executable (Cocoa Touch Application) you can then specify on a resouce by resource basis which items are included in your target. This can include only compiling certain code into your paid version.

You can get quick visual feedback on what is and is not included in the current target by right clicking on the "Groups and Files" list header (top lhs) and enabling Target Membership.

You switch between building different targets in the same way as you switch between building for Simulator or iPhone.

To specify at build time how a specific class behaves you can do two things - include two versions of the class which are each built for their respective target or, you can set a build time flag for the pre-processor. Select the Target in the "Groups and Files" list then "get info" on that target. Go to the build tab and search for "preprocess". You should see a n item called "Preprocessor Macros" add LITE to your lite target and in the same way add PAID to your paid target.

Thein in your source files you can determine at compile time which version you are compiling for using #ifdef LITE etc.

Going even further, you could set a global flag or AppDelegate member variable based on #ifdef LITE and change behaviour at runtime for the Lite and paid apps. I'm not sure I see value in that though.

我为君王 2024-07-20 20:19:02

作为开发人员,您希望编写尽可能少的代码(更少的错误,更少的时间)。 随着构建版本的不同,您将不得不投入更多的工作和单独的测试。

除非您正在制作昂贵的黑客工具,否则您可能会考虑使差异尽可能简单 - 只需一些隐藏的首选项或设置。 这样,大多数检查和测试将在两个版本中执行相同的工作,几乎没有代码会有所不同。 关键问题是不要给自己作为开发人员带来负担。

具有不同版本的原因是为了确保免费版本不会被破解为“付费”版本。 尝试规避如此简单限制的人主要是那些对手机进行越狱的人。 无论你做什么,在任何情况下你都不会得到他们的钱,除非他们惊叹不已,他们购买它只是为了表示欣赏。

As a developer you want to write the least code possible (less bugs, less time). As the build versions diverge you will have to invest more work and separate tests.

Unless you are making an expensive hacker tool you might consider keeping the difference as simple as possible - just have some hidden preferences or settings. This way the majority of checks and tests will do the same work in both builds, very little code will be different. The key concern is not to burden yourself as a developer.

The reason to have divergent builds is to ensure that the Free cannot be hacked into a "Paid" version. The people who would try and circumvent such a simple limitation are primarily a sub set of those who would jailbreak their phones. No matter what you do you will not get their money under any condition other than they are so wowed they buy it just to show appreciation.

叫嚣ゝ 2024-07-20 20:19:02

“Flower Garden”的创建者在这里详细介绍了创建精简版的不同方法的优缺点:

http://gamesfromwithin.com/from-full-to-lite-in-under-an-hour

The creator of "Flower Garden" details the pros/cons of different approaches to creating a lite version here:

http://gamesfromwithin.com/from-full-to-lite-in-under-an-hour

妥活 2024-07-20 20:19:02

使用 iPhone 3.0,您可以改为使用应用内购买,无需制作多个应用即可解锁全部功能。 我还认为这将避免人们免费获得这个,但我对此不太确定。

With iPhone 3.0, you can use in-app purchases instead and allow that to unlock the full functionality without having to make more than one app. I also think that this will avoid people getting this for free, but I'm not as sure about that.

紫轩蝶泪 2024-07-20 20:19:02

我使用了 git 分支。 我对主应用程序进行了分支并进行了一些调整以禁用大量内容。 现在我主要在 master 分支工作,并在发生重大开发时切换到 lite 并合并到最新版本。 效果很好。

I used a git branch. I branched my main app and made a few tweaks to disable a bunch of content. Now i work mainly in the master branch and switch over to lite and merge in the latest when major developments occur. Works very well.

尝蛊 2024-07-20 20:19:02

更好的方法是只有一个项目,而有多个目标——每个版本的应用程序都有一个目标。 那么什么是目标:多个目标

The better approach is to have just a single project, with multiple targets instead – one for each version of your app. So what are targets: Multiple Targets

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