混乱如何使osx app向后兼容&如何测试他们 [英] confusion of how to make osx app backward compatible & how to test them
问题描述
after reading the apple SDK guide https://developer.apple.com/library/mac/#documentation/developertools/conceptual/cross_development/Overview/overview.html
我还是困惑如何使Mac应用程序向后兼容&如何正确测试它们
I'm still confused of how to make the mac app backward compatible & how to test them properly
我有一个应用程序,我运行它,并在山狮10.8测试它没有任何问题,但我想让这个应用程序向下兼容,使其他用户可以在mac 10.6 - 10.7机器上运行它。
I have an app, I run it and tested it on Mountain Lion 10.8 without any problem, however I want to make this app backward compatible so that other users can run it on a mac 10.6 - 10.7 machine.
-
我有一个苹果开发者ID, 10.7和10.6的版本,但问题是,我有一个2011 macbook空气,目前运行10.8,这是唯一的苹果机,我有。我可以在我的项目设置中使用vmware或parallels?
I have an apple developer id and I can download the old versions of 10.7 and 10.6, but the problem is, I have a 2011 macbook air which is currently running 10.8, and that's the only apple machine that I have. Can I test the 10.7 and 10.6 by using vmware or parallels?
测试10.7和10.6,我将目标部署设置为10.6运行我的应用程序),但我应该将我的SDK设置为10.8或10.7?如果我将SDK设置为10.8,但目标部署设置为10.6,如果我修复所有的xcode警告将在10.6运行成功。
in my project settings, I set the target deployment to 10.6 (as I want 10.6 users to run my app), but should I set my SDK to 10.8 or 10.7? if I set the SDK to 10.8 but having the target deployment set to 10.6, if I fix all the xcode warnings will it run successfully on 10.6??
SDK下拉列表中,我只能设置为10.8或10.7,但是缺少10.6,我该如何解决?
from the SDK drop down, I can only set to 10.8 or 10.7, but 10.6 is missing, how do I fix that?
提前感谢
推荐答案
我开发了一个10.8的盒子,并支持回到10.5。就在几个月前,我们删除了10.4 PPC支持,我仍然清理一些10.2特定的代码。这可能会得到一点点,但我一直在做旧版本很长一段时间。我对此有一些意见。
I develop on a 10.8 box and support back to 10.5. Just a couple of months ago we dropped 10.4 PPC support, and I'm still cleaning out some of the 10.2-specific code. This may get a little rant-y, but I've been doing old versions for a long time. I have some opinions on the matter.
- 无论苹果在他们的文档中说什么,如果你想支持10.6, 10.6 SDK。不要依赖分发目标。
- 我已经与Xcode工程师进行过讨论,虽然他们坚持苹果的派对线,你应该总是用最新的SDK构建,他们也承认,它通常疯了这样做。如果您针对10.8 SDK构建并将部署目标标记为10.6,请使用不存在的方法时不会收到警告于10.6。唯一的方法,你会发现,你使用了一个不存在的方法,它可能会给你奇怪的错误,当运行在10.6。
- 请记住,当您发送未知选择器时,OS X不会崩溃。它只是中止当前runloop。
- 当然,您可以执行 /developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/cross_development/Using/using.html#//apple_ref/doc/uid/20002000-SW6\">微弱链接。谈论危险....是的,有几次这是有用的,但如果你不正确地做,编译器不给你警告。如果我要做这样的弱链接,我走另一种方式,链接到旧的SDK,并将新函数的原型复制到我的实现。
- No matter what Apple says in their docs, if you want to support 10.6, then build with the 10.6 SDK. Do not rely on distribution target.
- I have had this discussion with the Xcode engineers, and while they hold to Apple's party line that you should always build with the latest SDK, they also acknowledge that it's generally insane to do so. If you build against the 10.8 SDK and mark your deployment target at 10.6, you will get no warnings for using methods that do not exist on 10.6. The only way you will discover that you've used a nonexistent method is that it might give you strange bugs when run on 10.6. That's insane.
- Remember, OS X doesn't crash when you send an unknown selector. It just aborts the current runloop. So the bugs are even harder to track down then on iOS, where it crashes the app.
- Sure, you can do weak linking. Talk about dangerous.... Yes, there are a few times this is useful, but the compiler gives you no warning if you don't do it correctly. If I'm going to do weak linking like this, I go the other way, linking against the old SDK and copying the new function's prototype into my implementation. That way I have documentation of every function I think I'm going to weak-link.
- 嫉妒他们。苹果会尝试每次升级Xcode时删除它们。制作你自己的副本,并把它们粘贴在/ SDKs或别的地方远离Xcode。我提供了一个脚本 fix-xcode 来自动管理符号链接。我在苹果痛苦,因为他们坚持删除我的旧SDK?是,我是。
- Guard them jealously. Apple will try to delete them every time you upgrade Xcode. Make your own copies and stick them in /SDKs or somewhere else away from Xcode. I provide a script called fix-xcode to manage the symlinks automatically. Am I bitter at Apple for their relentless insistance on deleting my old SDKs? Yes, I am.
- 或者你可以做我所做的,有一小堆旧MacBooks,每个都有两个或三个分区,你一直重新启动。
- 现在10.7来自App Store,有点难以做出VM 。我强烈建议在安装后立即快照您的映像,并做一个干净的备份副本。
- 当您需要回到原始计算机时,您需要不时地克隆该映像。 出来。 10.8将有一天老。
- Or you can do what I do and have a small pile of old MacBooks each with two or three partitions on them that you reboot all the time.
- Now that 10.7 comes from App Store, it's a little harder to make VMs. My strong recommendation is to snapshot your image immediately after install, and make a clean backup copy of it. You'll want to be able to clone that image from time to time when you need to get back to a "raw" machine.
- Get in the habit of squirreling away SDKs as they come out. 10.8 will be old some day. You might as well make a copy now while it's easy.
这篇关于混乱如何使osx app向后兼容&如何测试他们的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!