OS X App - deployment target set to 10.6 in Xcode, but app only runs on 10.7 - cocoa

I've just discovered that my current version of the app doesn't launch on 10.6.
It used to work fine in 10.6 before. So I must have changed something in recent versions. So before I dive in and start comparing the source codes, is there a way to find out what cause the app not to launch in 10.6 but works fine in 10.7.
Details:
Xcode 4.3
LLVM compiler 3.1
Deployment target set to 10.6
Also, would Xcode warn me if I'm using a 10.7-only API in my code?

Related

Mac App Backwards Compatible to Yosemite

I'm on El Capitan in XCode 7.3.1 and Swift 2 trying to make my mac application work on Yosemite (it just doesn't open at all with no crash logs).
I have 10.10 set as the deployment target, but that didn't change anything.
I downloaded Xcode 6.4 on another machine and loaded the project and it's complaining a ton about all of my swift code not being a thing.
I'm assuming (hoping) I don't have to figure out how to write this in an old version of Swift in order to make it work on Yosemite.
How do I know which features of the new SDK need to be made backwards compatible?

Test OSX App on Yosemite from ElCapitan

I have developed an OSX for 10.10 and above. This app works with a device in which whenever I connect device and perform some operation, the data on device gets updated on the server. This works fine on El Capitan but one of our client has mentioned an issue on Yosemite, but I've update my Mac from OS X Yosemite 10.10.4 to OS X El Capitan 10.11.1 recently. I've heard that Xcode scheme can be used to define targets for build, but I'm not much aware of using schemes. Is there anyway to simulate Yosemite on El Capitan for testing? Is there anyway to do this through Xcode?
You can choose the Deployment Target in the project settings:
However, it's not 100% reliable even if 10.10 SDK was used to compile on 10.11.
Some XIB files produced on 10.11 in Xcode were sometimes not compatible with 10.10 and not detectable when testing on 10.11, but will crash on 10.10.
e.g. When I use 10.9 SDK to compile a project on 10.10 result in crashes when the NIB files get loaded on 10.9. Some other 10.10 users reported crashes running 10.11 compiled binaries for unknown reason...etc.
To be sure it's 100% working, you should consider setup virtual machines of older versions of OS X.

My Xcode app won't launch on other Macs

My OS X application that I've created on Xcode won't launch on other Macs. It works perfectly fine and the way it should on my MacBook, where I created it, but on other MacBooks it just bounces on a dock for less than a second and disappears and it won't launch. I built my app on Product - > Archive
How can I make my app to launch on other Macs also? The minimum requirements are 10.7 and when I try my app on 10.6 it says it requires 10.7 or newer, but when I try it on other macs that do run 10.7 or 10.9 it won't launch. What to do?
When you create a Mac application project in Xcode, Xcode sets the deployment target to the version of OS X you're running. The deployment target is the earliest version of OS X that can run the application. When you created your project in Snow Leopard, the deployment target was set to 10.6, which means the application will run on 10.6 and later. When you created your project in Xcode 5.1, the deployment target was set to 10.9, which means the application won't run on earlier versions of OS X. That's why your project runs when you create it in Snow Leopard but not on Xcode 5.1 on Mavericks.
To support earlier versions of OS X, the first thing you must do is set the deployment target to the earliest version of OS X you want to support. If you set the deployment target to 10.7, the project will run on 10.7 and later, assuming you don't use any technologies or function calls introduced in later versions of OS X. For example, if you create a SpriteKit project, it won't run on anything before 10.9 because Apple introduced SpriteKit in 10.9. Xcode will not tell you when you use function calls introduced in later versions of OS X. You are responsible for making sure your code uses only functions available in 10.7.
You should also check the deployment target for your xib files.
To support 10.7, you must turn off base internationalization for your project. Base internationalization works only on 10.8 and later. To support 10.6, you must turn off auto layout for your xib files.
You can access your project settings by selecting the project from the project navigator on the left side of the project window. You can access xib file information by selecting the xib file from the project navigator and opening the file inspector. You can find more detailed information in the following article:
Supporting Earlier Versions of OS X and iOS

Mac application with snow leopard canot run in leopard os

I am working in a mac application with snowleopard.This application is created with leopard os,but this not support in lion due to some external application.So we converted this to snow leopard and work fine .Now the client need to convert this application to leopard version ,for that i am using the xcode 4.2 and lion os and convert the bsec SDK to Mac osx 10.5 and Architecture to 32_bit intel ,but we getting an error "The run destination My Mac 64-bit is not valid for Running the scheme 'AppName'."
How can avoid this error ?
I want to test this application with 10.5 os, but we have only the 10.6 & 10.7 osx,
1)where we get the leopard osx ?
2)Has the Apple issue leopard osx now?
3)Is any problem for instal the leopard os to new MAC system(iMac,Macmini,Macbook)?
I had the same problem a while back, but I'm recalling the solution from memory, as my company dropped 10.5 support meanwhile. The details might be a little bit off, but it should get you going in the right direction:
Grab the latest version of Xcode 3 from the Apple Website
Install it on a Mac. (Make sure you removed the Developer directory if this Mac had another version of Xcode already installed).
Under /Developer, locate the 10.5.sdk directory. Move this directory to a save place (outside of /Developer).
Install Xcode 4.2.
Look where Xcode 4.2 installed its sdk's. Put your previously saved 10.5.sdk directory next to it.
Restart Xcode. There should be 10.5 SDK option in the SDK drop down menu now.

Xcode built app on 10.6 wont run on 10.5.8

I am new here and new in Xcode world.
I made a simple app with Xcode 3.2 on Snow Leopard.
The resulting built app works on snow leopard, however it will not even start on leopard (10.5.8) - I get message "You cannot use this version of application with this version of Mac OS X". Is it normal?
Or is there a way to make app that will work both on Snow Leopard and Leopard? Please advise, as I have no way to find out myself
Thanks for any input
You need to change the deployment target in your Build Settings. You should set it to the lowest version of OS X that you're willing to provide support for. You should set your base SDK to the latest available public SDK.
If you do this, you must ensure that you only use new 10.6-only APIs after doing runtime checks for their existence. To do this, you can use functions like NSClassFromString and respondsToSelector:.
Any Frameworks or libraries that are new to 10.6 should be weak-linked. This will prevent the app from trying to load those frameworks on 10.5 and thus cause the program to crash when it doesn't find the frameworks.
All explained in the SDK Compatibility Guide from Apple (Requires (free) login).

Resources