I have an app I made for Lion but I want it to run on Mac OS versions as low as 10.4 - macos

I created an application for the latest version of Mac OS X (Lion). My application uses ARC. I would however like it to be able to run on earlier versions of OS X.
My xcode says the earliest deployment target I can go is 10.4
By setting it to 10.4 does that mean I have done all that is required for my application to run on earlier versions of the OS up to 10.4?
Any help would be awesome thanks

There are a ton of API differences between 10.4 and Lion. Without seeing your app I cannot say for sure, but I would expect that it would not work correctly on 10.4 without some major changes. My suggestion is to forget about 10.4. I would be surprised if even 1% of OS X users are still running it. Stick with 10.6+ and you should be fine.
Whatever you do, only support versions that you have the ability to test on. If you don't have the capability to test on 10.6 you might even consider just supporting 10.7. If you cannot test on all of your deployment targets then you are setting yourself up for some pain.

ARC isn't supported for OS X 10.4 or 10.5. ARC is supported on 10.6, but has some problems that are not present on 10.7 (see question on this site). This isn't a show-stopper, but you should be aware of it if you use weak references.
According to Chitika (source), based on web traffic as of November 2011, 94% of Mac users were using 10.5 or newer and 72% were using 10.6 or newer. Those who haven't upgraded to 10.6 are less likely to be paying customers.
In my experience, developing a Mac application against an older SDK generally works without a hitch, but if you don't have access to an older system then you should warn your users that your application is untested on older systems. This is an unfortunate reality for independent developers. For example,
This application has been tested and runs on OS X 10.7. It may also run on OS X 10.6 but it has not been tested. OS X 10.5 and earlier are not supported.

To put it in perspective, OS X 10.4 was released in 2005. The last security update for it was 2009.
I've been developing for the Mac for the last 10 years, and my rule of thumb is it's usually OK to target the current OS version and only the previous one. Maybe even just the current version, if there's a compelling reason (new API) or the public knows a new OS version is coming out soon.
Example: in Spring 2012 everyone knows that OS X 10.8 will be released in the Summer, so new products I'd develop just on 10.7 with an eye towards 10.8.
There are a few markets where you'd want to do anything different (education being one), but these are few, far between, and usually only apply to long standing products.

Related

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
I'm still confused of how to make the mac app backward compatible & how to test them properly
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.
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?
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??
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?
thanks in advance
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.
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.
Download the old SDKs and symlink them into your Xcode distribution.
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.
You can run 10.6 Server in a VM legally. You can run 10.7+ Desktop in a VM legally. These are good ways to test your code.
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.
Whether you support individual dot-releases or not, it can be very helpful to keep around the upgrade packages for individual dot releases. When you encounter customers running non-current releases, it's nice to be able to check whether an "unreproducible" bug in fact is easily reproducible on their specific version. Whether this is worth it or not depends heavily on your product and customers. It was a life-saver for me when 10.4.11 made major changes to WebKit during a dot release...
Invest in a small NAS or a big external USB drive (though I've had trouble with those failing when used extensively, so I prefer a RAID). You'll need the space. You want to hold onto lots of VMs and lots of SDKs and sometimes even old versions of Xcode.
Adding to Rob Napier's great in-depth answer:
To use an old SDK, put the SDK (or a symlink) to it here:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
With XCode 7.3 or later, you need you to open this file and change "MinimumSDKVersion" (otherwise XCode will refuse to use the old SDK):
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist
You can install multiple versions of Mac OS on a single machine, booting between each.
The SDK should be the latest (10.8).
See 2.
One alternative to 1 that I've considered (I am in the same boat) is to create a Snow Leopard Hackintosh using an old PC and just installing Lion and Mountain Lion on my MBP.
You need to do these settings :
1.Set the Base SDK to Current version of Mac (ex. 10.7)
2.Set the Deployment SDK to older version (ex.1.4)

Simulate run on older OS X version

How can simulate a run on a older OS X version ?
Right now my app works on 10.7 and 10.8 but I want to make it compatible with 10.6. Since I'm using some new apis I'm still compiling with the 10.8 base SDK, I can only change the deployment target.
So on my OS X 10.8, how can I simulate a run on OS X 10.6 ? (If it's possible)
Thanks
TheZ mentions virtual machines. Lots of hoops to jump through with licensing.
My personal "path of least resistance" was to use an old PPC Mac Mini and an almost-as-old intel-based. PPC runs 10.4 for old app testing; Intel mini boots various OS versions with which to test. All install images are disposable and can be restored from a network volume for a clean environment no matter what I do to it.
If you don't care about PPC, then just get a used Intel Mac Mini, partition it for the older OS versions and use it exclusively as a test environment.
2022 Update: Apple has relaxed their stance on virtualization. Today I use VMWare (Parallels works too).

How do I add Leopard and Snow Leopard support to a Lion Cocoa App?

I have developed a Cocoa App on Lion and now I would like to add compatibility with Leopard and Snow Leopard.
I tried to set the development target to 10.5 but it still has crash problems on Leopard and Snow Leopard.
I tried also to open the project with old versions of Xcode, but I get hundreds of compile errors (I guess it's because I can't compile the program with the old Mac OS SDK)
Do you have any advice about solving the retro-compatibility problems of Cocoa Apps?
I think it's generally not a very good idea to develop for the latest OS then try to support older OSes at the last minute. If you've used any APIs that were introduced in an OS later than the oldest you're trying to support, you'll have to rewrite code to avoid using those APIs. It's generally not worth the trouble.
That said, there's no secret to supporting older OSes. You just need to make sure that you only use APIs (classes, methods, functions) that are available on the oldest OS you're trying to support. You'll notice when looking at the documentation that for each method, under "Availability", it will tell you which versions of the OS include that method. Something like:
Availability
Available in Mac OS X v10.6 and later.
Assuming you don't use any APIs not available on an OS version you're targeting, all you need to do is set the deployment target to the lowest OS you're targeting, and build. You will of course also want to test thoroughly on each OS version you're supporting.
Your question would be easier to answer in more detail if you elaborated on the "crash problems" you're seeing on Leopard and Snow Leopard.
First, install the 10.5 SDK on your Mac. This may not be necessary, but do it anyway. You can find instructions on the Internet. Keep in mind that compiling with the 10.5 SDK will ensure compatibility, but you won't be able to use newer OS X features unless you load them dynamically.
Second, go into your .xib files and on the File Properties tab (first notch in the Inspector pane) disable auto layout and set the deployment target to 10.5.

Does the Mac Developer Program have old versions of Mac OS X?

I'm developing something for Mac OS X. It's a port of a Windows product.
One of my boss' concerns is how it will run on older versions of Mac OS X. I know Xcode has facilities for compiling for old versions of Mac OS X, but QA would prefer to actually run the older versions of Mac OS X on a Macintosh.
Since we got into Macintosh development after Snow Leopard was released, all of our machines come with Snow Leopard (10.6). As far as I know, you can't really walk into a store to buy Leopard (10.5) and anything prior to that is basically extinct.
In a question on virtualization someone said that they've done multi-boot or multiple hard drives for other versions of Mac OS X, but I'm not sure how one would obtain the install media or the license for an old version.
I see Apple has their Mac Developer Program which touts as one of its features as "access pre-release versions of the latest software" which is cool, but I don't see it anywhere on there that old versions of Mac OS X are available. Does Apple have an MSDN-equivalent where old versions of the software are available for download?
Also, is there a reliable breakdown somewhere of the rate of upgrades/updates to Mac OS X? (i.e., what % of users still run Mac OS X 10.5, 10.4, PPC-based machines, etc.)
In case you buy an old OS X from Amazon or other retailers, note that you can not install an OS which was released before the hardware was announced. Older OSes just don't have the required driver to be able to run on a newer machine, and Apple doesn't back-port drivers for older OSes. In other words, if you buy the latest new Mac from Apple, you can't install 10.5 or 10.4 or whatever. So, you need to buy an old Mac too, not just an old OS.
The breakdown of the OS ratio really depends on the software. For example, the veritable Omnigroup publishes this version breakdown of the hits of their software update server. There are many websites which tell you the version break down, see e.g. this site.
Judging from it, I would say Snow Leopard covers half of the Macs in the world. Supporting Leopard might be worth while if you have extra resources. But I would guess people who didn't buy Snow Leopard won't typically buy a new 3rd party app, so supporting Leopard won't give you 50% increase in the number of potential buyers. (I admit this last sentence is completely subjective, though.)
Apple Developer Connection does have most older OS version available for download, but it's not quite from a complete collection (specifically, they're missing a full install of 10.4.anything for Intel CPUs). They do have the GM builds of 10.6.0 (which is Intel only), 10.5.0 (Intel/PPC universal), 10.4.0 (PPC only), 10.3.0, and 10.2.0.
As others have said, you won't be able to use older versions of the OS on newer hardware, so you're going to have to get used computers for testing -- if purchasing doesn't like eBay &c, look for a company that specializes in used equipment, like PC Recycle. For maximum coverage, I'd recommend getting an Intel Mac that shipped with 10.4 (and make sure you get the installer disks that came with it), and a PPC Mac with that's as old as possible while still having a 867MHz+ G4 CPU (so you can run 10.5 on it, and don't have to worry about weird G5 builds) (again, be sure to get its original disks 'cause an older generic installer won't work).
One option (besides acquiring old OS versions yourself) is to use the compatibility labs that Apple maintains. Lots of machines, old and new, already set up with many different versions of the OS.
I believe you can get a "day pass" to the labs for ~$100. Depending on where exactly you're located and the cost of getting to Cupertino, this may or may not be a viable option for you.
http://developer.apple.com/labs/
As others noted, a number of sellers on Amazon have boxed old versions of the OS.
Historically, people used to boot off external Firewire drives to use older or beta OS versions, but of course some of the newer machines lack Firewire ports. I know EFI does support some external boot options (netboot for instance).
It might be possible to boot newer Intel hardware using a late version of 10.4 - but I couldn't guarantee it (as another poster noted, 10.4 won't have relevant hardware drivers - but there are basic generic drivers that may work. Then again, is that a realistic test???).
As an addition to Yuji's post - there are some people who are forced to stick with Leopard or Tiger for compatibility reasons (my father can't upgrade all the machines at his school, because the A3 colour printer only has generic printer support under Snow Leopard, and they also have a lot of older Adobe software). I would say that generally this applies more with institutional customers - for educational software running on 10.4, and even running on PowerPC hardware, can still be a significant issue.
For consumer software - less so - the big spike in Mac sales came after the switch to Intel, and almost all active consumer software purchasers are on Intel machines running 10.5 or later.
The other thing that needs to be considered is that 10.4 is missing many APIs introduced in 10.5 and 10.6.

Test build of Cocoa application not compatible with tester's version of OS X

I've been building a basic Cocoa application with Core Data and Interface Builder, and no extra coding, frameworks, or header files. I sent it to someone to test on their machine (a last-gen G5 iMac), and they got a message saying that their machine couldn't run it. I discovered the switch to compile for PPC, so I built a PPC version of the application to try out, and that produced the following error message:
You cannot use this version of Application on this version of Mac OS X.
I'm running Xcode 3.2.1, Interface Builder 3.2.1, and OS 10.6.2. The conversation with my tester was a bit confusing; at first it sounded like she only had Tiger on her machine, saying Leopard was incompatible (I corrected and said that Leopard should be, it's Snow Leopard that isn't), and then by the end of the conversation she was about certain that her machine was running Leopard, but had already shut it off by then. So I'm not sure which version of OS X is on the offending iMac, but it's the latest version of either 10.4.11 or 10.5.8 (the tester is in a remote location, so I can't verify personally at the moment).
What can I tweak to try and improve compatibility on my tester's machine?
If they're seeing that message, it's most likely because your app has the LSMinimumSystemVersion key (Minimum system version) set in the Info.plist. You should take this key out or set it to the actual the minimum OS X version you support.
Once you do this, you may well run into the next problem. (Probably a dynamic linker error as a result of using a framework or API that didn't yet exist on 10.4 or 10.5.)
The main problem here is that you're sending it out to a system where you haven't actually tried it. If you plan to support 10.4, 10.5, or both, I highly recommend that you find a spare hard drive, partition it up, and install 10.4.11 and 10.5.8. There are many issues that will crop up on older OS's and if you haven't tried it yourself, it's unlikely it will work smoothly on the first try.

Resources