Simulate run on older OS X version - xcode

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).

Related

Is it possible to develop PowerPC applications on OS X Yosemite?

I have an iMac g3 running Tiger 10.4.11. I'm really interested in developing applications for it, but I would like to do all of the programming on my Macbook Pro(running Yosemite).
Is it possible to build an application on Yosemite that will run on PowerPC macs? I've tried downloading xCode 3.1.4, but it isn't supported on Yosemite.
Yes, you can. What you need to do is restore PowerPC support in your version of Xcode like described here: https://github.com/devernay/xcodelegacy
I'd imagine you cannot. Apple stripped PowerPC emulation from it's latest versions of OSX so if you can't run the apps it's only logical to think that you couldn't develop or compile them.
As far as I'm aware the latest version of OSX that can run PPC apps is Snow Leopard, although I cannot comment on Xcode support for developing for PowerPC architectures.
Yosemite as far as I'm aware definitely will not serve as a platform to develop PowerPC apps.

Is an app created in Qt on Mavericks executable on other osx

I usually use a computer on snow leopard to create apps compatible upwards but I'm on holidays at the moment and only have my macbook pro with Mavericks on it.
I need to send an app to a customer who's on snow leopard (or lion)
Is this possible? Can I create a compatible app building it on Mavericks.
I'm not an expert on building on Mac, but I believe it is/can be. If the target computer also has Qt 5, then it should work.
There used to be "Universal" binaries that would work with both Intel based Macs and with Power PC based macs... I've seen that break on my Mavericks install for some things that were built with a "Universal" binary. It might be just a problem with that one or two programs I was running.
The default compiler for Mavericks and Qt 5 is clang64, and so it should work on any 64 bit Intel based mac. Make sure you are using the commandline deployment tool for qt mac deployment, so that all the dylib's get included in your app package.
Hope that helps.

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

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.

Testing on different version of Mac without buying OSX Server or multiple machines

On Windows, testing different OSes is made simple using VMs. Is there a simple way to do something similar for Mac testing, where I might need to run on Tiger/Leopard/Snow Leopard to verify functionality?
AFAICT, to run OS X in a VM you need OSX server or buy multiple Macs - is that what folks out there do? Or are there other cheaper options?
Due to the license, you must use Mac OS X Server if you'd like to virtualize. If you get an early Intel mac that will run 10.4, you could partition the disk and install 10.4, 10.5, and 10.6 simultaneously, though rebooting in to each OS can be a hassle.
These days there are more Mac OS X variants to test than just major OS releases. Depending on your target customers, you might also want to test on PPC, i386, and x86_64 architectures.
If you're lucky enough to live near Cupertino, Beijing, or Tokyo, and you're an ADC Select or Premiere member, you can use the ADC compatibility labs for this sort of testing.
That said, you could probably pick up a couple of older machines pretty inexpensively and get somewhat varied hardware.
You could have a single Mac with different partitions for each OS, or you could virtualise OS X server. Within the constraints of Apple's Mac OS X EULA you cannot virtualise Mac OS X.
The paid-for memberships of Apple's developer connection include the ability to download and use a range of previous versions of OS X and OS X Server for developer testing purposes. As the select membership is $500 and OS X Server is $499 then I'd think that's going to be cheaper if you want to test more than one variant of the server.

Is there a way to get/use the OS X 10.3 Cocoa SDK on a 10.6 machine?

Before you ask, yes, I have a very good reason for wanting something to run on 10.3. It's a very small in-house project that must run on a very important person's machine, which cannot be upgraded for a very good reason. =)
The 10.6 DVD doesn't seem to offer an option to install the 10.3 SDK, only 10.4+. I also can't seem to find it on Apples website.
I found this tip about how to install it on 10.5, via the Xcode optional installs, but that doesn't seem to be the case for 10.6?
http://www.cocoabuilder.com/archive/cocoa/201508-10-3-9-sdk-with-xcode-2-5-on-leopard.html
Is it incompatible, or just not offered because it's so old? Must I use an earlier version of Xcode? Can I just try to install it via a <10.6 DVD?
You don't need the Mac OS X 10.3 SDK to build for Mac OS X 10.3. Just install the optional Mac OS X 10.4 (Universal) SDK, then:
Set your Base SDK to the Mac OS X 10.4 (Universal) SDK
Set your Compiler Version to GCC 4.0
Set your Mac OS X Deployment Target to Mac OS X 10.3 for the PowerPC architecture (using build setting conditions)
Carefully avoid any API that isn't on Mac OS X 10.3
This should be sufficient for building a Mac OS X application that will run on Mac OS X 10.3.9, even on Snow Leopard.
The 10.3.9 version number is important; if you're using any C++ in this application, Mac OS X 10.3.9 is the first version (and the only version of 10.3) that includes the Standard C++ Library in shared library form, which is required for using GCC 4.0 or later. Otherwise you'd have to use GCC 3.3, which is neither included nor supported with Xcode 3.2 on Snow Leopard.
On the other hand, C and Objective-C code may even run on earlier releases of Mac OS X 10.3. I can't think of a reason it wouldn't, but I haven't tried it myself. Even people sticking with a 6-year-old version of Mac OS X will use the most recent version of it, right?
If the 10.3 system is running 10.3.9, you may be able to use the optional 10.4u SDK for your build on 10.6 by setting the deployment target to 10.3 and sticking to gcc-4.0, rather than gcc-4.2, the 10.6 default. The python.org installers for OS X are intended to be built that way, that is, one executable that works on 10.3.9 through 10.6 (although, at the moment, there are still a few problems with building all variants on 10.6 so 10.5 is still used). Also the python builds are primarily using Carbon frameworks rather than Cocoa and they do not use Xcode to manage the building of the product. If you can't get Xcode to do it directly, you might be able to build from the command line.
export MACOSX_DEPLOYMENT_TARGET=10.3
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc ...
It may be that the 10.3 SDK isn’t supported on 10.6 because 10.6 is intel-only. Also, 10.3 doesn’t support intel. Remember that 10.4 was the first OS to support intel, which is why that’d be the earliest OS supported on 10.6. However, I could be wrong.

Resources