iPhone 3.0 SDK, how to test on a 2.2.1 device? - iphone-sdk-3.0

I just installed the latest iPhone SDK 3.0. After I seleced the active SDK as Simulator 3.0 at the drop down overview, the "target" field no longer shows me the 2.2.1 SDK, and defaults to 3.0, resulting in I cannot test on my 2.2.1 device.
What actions should I follow to fix this? Even in the target property my base SDK still appears as device 2.2.1.

You cannot run an iPhone application compiled for 3.0 on a device running anything other than 3.0 as it is not backwards-compatible with 2.2.1. You'll need to upgrade your device in order to run 3.0 apps on it.
More specific to the most recent release of the SDK, there is an entry in the release notes that states that this version does not let you compile against any SDK except the 3.0 SDK. I believe the last version that allowed you to do that was 3.0b2. You'll need to roll back to that one or earlier if you want to compile using the 2.2.1 SDK.

The setting you may want is the "iPhone OS Deployment Target" at the bottom of the Deployment section of the Info window for your project.
You can leave the "Base SDK" setting set to 3.0, and set the "Deployment Target" to an earlier version like 2.2.1.
search for "Target an earlier iPhone OS release" in
https://web.archive.org/web/20100901153956/https://developer.apple.com/iphone/library/documentation/Xcode/Conceptual/iphone_development/120-Running_Applications/running_applications.html
Then it's up to you to make sure your application doesn't try to use OS 3.0 features on an OS 2.2 device. (use weak references to any OS 3.0-only frameworks, check OS version before doing things that only work on some versions, etc.)

Right click on your project and select "Get Info".
Then from the "Base SDK for All Configuration", select "iPhone Device 2.2.1" and the options will be available again.
Jetzdax

Related

How to update mac OS application to support Catalina?

I have an old mac OS application developed in Mojave with the deployment target 10.12. Now how to update mac OS application to support Catalina? Or is the application automatically supports all future mac OS versions?
When developing for macOS (or any other Apple platform, for that matter), there are two key concepts to take into account when thinking about compatibility:
The SDK version: this is the SDK you're compiling against and it is usually determined by the Xcode version you're using to build your project.
The Deployment Target: this is the lowest OS version you want to support.
Normally, if you have followed the best practice in implementing your code and all of your dependencies have done the same, updating an app for a new macOS version requires only to download the latest Xcode on the latest macOS, build it and run your smoke tests (manually or through automated tests).
There may be things that have been deprecated in the meantime and Xcode will report them as warnings while building. You may read more about deprecated APIs in the macOS 10.15 release notes.
Keep in mind that you don't actually have to rebuild your app every time a new macOS version comes out. Even though it is better to test it at least once and dedicate time to explore and make use of new APIs, apps built on the previous version of macOS will, most of the times, run flawlessly on the next version (and maybe even further). This obviously depends on the app complexity, so your mileage may vary.

Is it possible to install Xcode 10.2 on High Sierra (10.13.6)?

I recently upgraded iOS in my iPhone device to 12.2 (to provide support of latest versions for my app "Match4app"), and this does not appear to be compatible with Xcode 10.1. Should I update Xcode to 10.2 ?
In my Mac with High Sierra, when I click "Update" for Xcode, 10.2 is not available.
I have found this link:
https://support.apple.com/en-us/HT209606
With this comment:
"Xcode 10.2
Released March 25, 2019
Kernel
Available for: macOS High Sierra 10.13.6 or later"
How can I install Xcode 10.2 with High Sierra in order to test iOS 12.2 ?
Note: Upgrading to Mojave or Catalina is NOT an option in my old Mac (though I will try to install the macOS Catalina Patcher soon (http://dosdude1.com/catalina/) ).
Yes it's possible. Follow these steps:
Download Xcode 10.2 via this link (you need to be signed in with your Apple Id): https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_10.2/Xcode_10.2.xip and install it
Edit Xcode.app/Contents/Info.plist and change the Minimum System Version to 10.13.6
Do the same for Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/Info.plist (might require a restart of Xcode and/or Mac OS to make it open the simulator on run)
Replace Xcode.app/Contents/Developer/usr/bin/xcodebuild with the one from 10.1 (or another version you have currently installed, such as 10.0).
If there are problems with the simulator, reboot your Mac
You don't need to run Xcode 10.2 for iOS 12.2 support. You just need access to the appropriate folder in DeviceSupport.
A possible solution is
Download Xcode 10.2 from a direkt link (not from App Store).
Rename it for example to Xcode102.
Put it into /Applications. It's possible to have multiple Xcode versions in the same directory.
Create a symbolic link in Terminal.app to have access to the 12.2 device support folder in Xcode 10.2
ln -s /Applications/Xcode102.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/12.2\ \(16E226\) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
You can move Xcode 10.2 to somewhere else but then you have to adjust the path.
Now Xcode 10.1 supports devices running iOS 12.2
Download xcode 10.2 from below link
https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_10.2/Xcode_10.2.xip
Edit: Minimum System Version* to 10.13.6 in Info.plist at below paths
Xcode.app/Contents/Info.plist
Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/Info.plist
Replace: Xcode.app/Contents/Developer/usr/bin/xcodebuild from Xcode 10
****OR*****
you can install disk image of 12.2 in your existing xcode to run on 12.2 devices
Download disk image from here
https://github.com/xushuduo/Xcode-iOS-Developer-Disk-Image/releases/download/12.2/12.2.16E5191d.zip
And paste at Path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Note: Restart the Xcode
Based on responses and comments below, the following was the simple solution for my issue and THIS WORKED. Now my app, Match4app, is fully compatible with latest iOS versions!
Download Xcode 10.2 from a direct link (not from App Store). (Estimated Size: ~6Gb)
From the downloaded version just copy/paste the DeviceSupport/12.2 directory into "Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport"
You can discard the downloaded version now (we just need the small 12.2 directory!)
None of the above helped for me.
I was able to install Mojave using this link here:
http://dosdude1.com/mojave/
This patch worked beautifully and without a hitch
Proof:
here's Mojave running on my (unsupported) 2011 Mac-mini
Cracked it. Just #Damnum steps and then follow the path to run xcode. Bad way but running like a charm.
Double click to /Applications/Xcode102.app/Contents/MacOS/Xcode

Will Mac application developed in latest XCode work in old OS-X?

I have MacOS-X - 10.7 and Xcode - 4.6.2 and made a Mac application. The client side machine is also MacOS-X - 10.7. But in my mac application there was a small error with NSNumberFormatter which when I was changing, Xcode was crashing. So I edited the code in latest Xcode and OSX. And then I made the binary of it and run in MacOS-x - 10.7, its working fine. But the source code is no more opening in Xcode - 4.6.2. Its asking for the latest version of Xcode. My question is will the binary will work fine in older version of OS-X even if it is developed in latest Xcode?
The version of OS X which your application will run on is dictated by the OS X Deployment Target in the project settings. If that is set to support 10.7, then it doesn't matter which version of OS X you built it on: the built application will work on 10.7 and later.
This setting will also set the minimum allowed OS in the Info.plist, so people trying to run the build on earlier OSes will see an alert instead of the app just crashing.
More information on setting the deployment target and building for different OS versions with SDKs is available in the Apple documentation:
https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html

Backward compatibility for OSX Apps

OK, so here's my situation :
I've got Xcode 5.1.1 on a 10.9 (Mavericks) machine
I want to build my app so that it runs on 10.6 and later
SDKs installed : 10.6, 10.8, 10.9
What do I have to do to make sure it'll show up as "10.6 and later" compatible in the app store?
I managed to get it to compile fine with Base SDK set to either 10.8 or 10.9, and Deployment Target set to 10.6. Will that suffice?
P.S. I've tried compiling with Base SDK set to 10.6, as well, but there are so many errors to be fixed, that it'd be better if I could avoid it.
So any ideas?
Yes; using 10.9 SDK with the deployment target of 10.6 will work fine.
You may find you have conditional code-paths which must be determined at runtime, perhaps based on respondsToSelector, which will require some #pragmas in order to compile successfully.
The Deployment Target defines the minimum OS version that your app requires at run time.
The Base SDK defines the level of API features that are available at compile time.
Therefore you can use 10.9 as Base SDK when building apps that can run on 10.6 and upwards.
You just have to make sure to avoid code paths that use 10.7/10.8/10.9 APIs when your app runs on a 10.6 machine.
As trojanfoe already pointed out, you can use respondsToSelector: to check if a certain class/method is available.
Another way is to use NSAppKitVersionNumber:
if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_8)
The NSAppKitVersionNumber constants for the latest SDK can be found in the AppKit Release Notes.
Further details can be found in Apple's SDK Compatibility Guide.

Debug 10.6 Project into 10.5?

Can I debug a 10.6 project into a 10.5? I have computers at school that are still 10.5 and I need to downgrade it so I can run my program on their computers.
Thanks,,
Kevin
I assume you mean you want to load your Xcode project onto the school computers.
First, are you using any 10.6 specific APIs? If so, you can't run your app on 10.5.
Right click on your project and Get Info. Then check some things:
General->Project Format: Is this an Xcode version that will be compatible with the school computer? 10.5 will be an Xcode 3.1.x system (pretty sure about this, though it could be 3.0.x)
Build->Base SDK. Is this set to 10.5?
If those look good, you should be set.
If you build against the 10.6 SDK, you can only run on 10.6 and higher.
If you build against the 10.5 SDK, you can run on 10.5, 10.6 and higher.