How to setup 2 iPhone SDKs on one Mac - iphone

Based on your past experience, will two iPhone SDKs co-exist on a single mac?
For example, one that is in beta and one that is released.
I am planning to just copy an existing SDK to a different folder before installing a new one - would appreciate any prior warnings!

When you install 3.2 beta, the others (e.g. 3.1.2) just stick around and are available as target SDKs.

The best way to do that is to have side by side installation. And it is Apple's recommendation to do so as if you plan to release an application on the AppStore it should be built against the official version of the SDK.
You should install the released version (official one) in a directory say 'developer'
and the beta one in a folder called for example 'developerbeta'
that way, you will have both versions of Xcode and all the SDKs.
Hope this helps.

Doing not Working's explanation is correct.
The only place you're going to see the official Apple recommendation is by getting a developers account (the free one will work I believe), signing the NDA and then (1) reading the installer readme or (2) checking out the iPhone 3.2 Apple Dev forum.
The SDKs have always been separate from the developer apps like Xcode. You can always compile any project in any version of Xcode with an earlier SDK. That has always been true. However, Apple will not accept any app built with the 3.2 dev tools, i.e. Xcode, Interface Builder, Instruments etc.
I would suggest running the 3.2 dev tools under a different users to prevent any preference file mixups.

You do not need to worry about doing this for keeping iPhone OS3.2 when installing iOS4 - apple has already included 3.2 in the iOS4 installation. But this is a good tutorial if you want to keep iPhone OS 3.0 or any pre 3.2 version for testing.
http://adeem.me/blog/2010/06/16/how-to-setupinstall-2-iphone-sdks-on-one-mac/

Related

How can I support both iOS 4.X SDK and iOS 5 SDK in my iPhone app?

I am writing an iPhone app in which I want to support the largest user base possible at this point in time (with minimal pain), so I decided that targeting IOS 4.3+ would be a good subset of users for my audience.
I started working in XCode 4.2, but reverted back to XCode 4.1 when I realized that the project templates had changed and everything seemed very intertwined with storyboarding, ARC, etc.
I have built out my application to the point I actually want to test on my device, which has iOS5 installed. When I attempt to use it though, I get this message as soon as I click 'use for development' in Organizer/XCode:
The project's build settings look like this:
My Question Is This: How do I get this application, built in XCode 4.1, to run on both iOS 4.3 and iOS 5 phones?
Are iOS SDKs not backward compatible? I come from Android development in which a less than current SDK will generally work on a newer SDK - is this different in the iOS world? And if so, how is this handled typically?
Any direction on how I should proceed would be greatly appreciated.
You can go ahead and open your app in Xcode 4.2 and it should still work. I've been working on a particular app since Xcode 3.x days and I'm nearly done, chugging along in Xcode 4.2 right now. It shouldn't be a problem. If you want to work with Xcode 4.1 you will be fine, but you won't be ale to use new features introduced in iOS 5.
There are several aspects of "cross-version" development to note.
Testing: You can only test on version of iOS that are included with your SDK, or that are installed on physical devices that you may have. The SDK generally comes only with the latest iOS, sometimes the previous one is included as well, but since Xcode 4 was released, the older SDKs have been progressively deprecated with each release. This is not to say that your app which is linked against the iOS 5 SDK won't run on older versions of iOS. It just depends on how you implement new features.
Features: In order to support older versions of iOS properly, you want to make sure that you don't implement new features without properly checking for the existence of classes, methods, and properties that were introduced in the newer versions of the OS. Unlike Android, you don't have to worry about a million hardware configurations. ;-)
Weak Linking: To support a new feature and still be compatible with older versions of iOS, you need to weak link against frameworks that you are using to implement new features. You can read more about that in the Apple Documentation on Weak Linking.
Deployment Target: The setting that prevents the app from loading on older devices is called the "Deployment Target". If you set this to 3.1.3, then your app will run on iOS 3.1.3 and higher. Remember that if you don't code the the proper version checking, your app may break.
ARC: You can choose to enable or disable Automatic Reference Counting when you create the project. ARC scans your program at compile time only, not at runtime, it doesn't break the app on older versions of the OS.
You need the latest version of XCode and the iOS SDK to install your apps onto your iOS 5.0 phone. That doesn't mean the inverse is true -- you don't need the same version of iOS on your device that you have installed on your computer.
Hope this helps!
You can use the latest SDK and simply set the "IOS Deployment Target" version to 4.3 in the project build settings.
XCode 4.1 doesn't support iOS5 in the sense that Xcode package doesn't contain the iOS5 SDK. So you must return to Xcode 4.2 and target your project for iOS 4.3 (you can also target it for iOS 4.0 with this Xcode version, but you will not be able to simulate it; you can even download older iOS 4.x package versions from the Xcode preferences menu if you really need to simulate them in your device).
You can opt-out of ARC if you want, this choice is given to you when you create the project, so don't worry; but consider that ARC does its magic at compile time only, not at runtime, so your backward compatibility will be kept if you decide to use this technology. Finally if you don't want Storyboard just pick the Empty app template and it will simply put in your project only the basic files. From this template you can create any iOS app, this is the approach I normally follow.

Minimum iOS target version that Apple accepts in AppStore?

I have an application that I would ideally like to run on all iOS versions, however I think Apple accepts apps only from a version and above (3.0 I think, but not sure). So my question would be, what's the minimum iOS target version you can send in review (and get accepted). If anyone with greater iOS publishing experience would answer my question it would be great and maybe point out some places where I can read about it.
Many thanks!
Sometime last year, an Apple DTS employee posted (and later clarified) on the iOS Developer Forums that the App store would no longer be accepting apps with a Deployment Target lower than 3.0. That might indicate that a lower Deployment Target has or will become grounds for an app to be rejected.
I would never set the Deployment Target lower than that of the lowest OS version among the devices I plan to use to test the app before submitting it to the App Store.
Also, the installed based of devices which haven't been upgraded to 3.0 or above might be too microscopic to be worth a developer's time or effort (unless you happen to still have and use one for some reason).
ADDED in 2013: App store submission now requires that the app support the 4" display, which requires iOS 6.0 or later, which allows a minimum deployment target no lower than iOS 4.3
To back up what hotpaw2 indicated, this is from the News and Announcements for iOS Developers on June 29, 2010:
Make sure that your applications are
compatible with iOS 4. All new
applications and updates to existing
applications must be built with iPhone
SDK 4. In addition, the App Store will
no longer support applications that
target iOS 2.x.
ok... strangely Im having a hard time verifying this... but it's my belief that you must build your app with the latest base SDK (4.0), but you can target an IOS version all the way back to 2.0. Ill continue to try to verify that.
You can only build your apps with the SDKs you have installed.
Since XCode will nuke your old SDKs whenever you upgrade (unless you install XCode elsewhere), it is assumed that you will always be building using the latest stable SDK version. This is in contrast to, say, Android, which will always retain SDKs whenever you upgrade.
Your deployment target can go back as far as you want, right back to 2.0 - but you may find it difficult to actually test it on that platform! Most people would just target 3.x upwards, which gives you as close to 100% coverage as makes no difference.

How do I Ensure my Application's iOS Deployment Target will be Usable for that SDK?

I would like to set my iPhone App's iOS Deployment Target to the minimum possible SDK, which appears to be iOS 3.0 in Xcode version 3.2.6. Thus far, the base SDK I have been running against has been the latest (iOS 4.3). How can ensure that I am not using any newer features (i.e. since iOS 3.0) in my code, and that the application will not crash for the older iOS versions? Do I just need to find and install the older iOS SDK? If so, where may I find these version controlled SDKs?
Thanks,
Jeremy
You could try to run it on a device with the older sdk (we keep devices around with 3.1.3 for instance). However, you won't be able to find a downloadable version of the old OS from Apple.
If you don't have a versioned device around, the best way would be to look at any "suspicious" pieces of code that might have new features and make sure they are available in your base OS version (using the class references)
Yes, it's a bad system, but now you can start to keep old sdks around (i always make a copy onto a local storage device before I install a new version). As for restoring your device: I think you have to have made a backup at some time (i'm not 100% sure). But if you could I think it would be in organizer on Xcode and I guess you could check in iTunes too.

iPhone App Run Different iOS

I am getting a fat binary when I go to upload, and I want to make sure that my application can run across 3.0, well even 2.0. Is there a specific way to make sure that this will show when I go to upload. I am not using any specific iOS 4 features, and I only have iOS 4 in my xCode. How can I test different iOS version?
The only way as I could think of is test your app on real old OS version devices. Since Apple prefers its users to upgrade to new OS version as soon as possible, they don't actually provide an official way for developers to test such backward compatibility.
Another relevant questions would be, "can I downgrade my device OS version to an old one, so that I can test my app on them?" I once did a research on SO and other Apple forums, and the result I got was NO, we developers don't have a way to "officially" downgrade our device OS version. Yes there are exceptions, you can try jail-breaking and then downgrading.
For jail-breaking / downgrading your OS version, check this post, A TimeMachine taking my iDevice back to 3.1.2? .
Edited: It's actually pretty easy to make sure that users with old OS versions can downloaded and install your app. All you need to do is set the Deployment Target in Xcode to the lowest OS version you want (iOS 3.0 would be the lowest in Xcode 3.2.5).
However, you need to bear in mind that such Deployment Target only ensures that your app can be downloaded and installed on such old version OS devices. They don't ensure compatibility during runtime. You still need to test your app on real old OS devices to ensure compatibility.
I dont think u need to worry about app version 3.0 below because it is not supported anymore. but how to test on different version, make sure change the iOS deployment target as Thomas refered.
There is no currently supported way to do this.
No current Simulator or Xcode tool will ensure that an app is completely compatible with an OS version older than the SDK used. The 2.0 SDK is not compatible with the current development tools. There is no officially supported way to downgrade a device.
Furthermore, Apple no longer even accepts app submissions that have a deployment target lower than 3.0.
Even most old 1st gen devices, if you can find one on eBay, have been upgraded to iOS 3.1.3. But if you have access to an old device running iOS 3.1.3, you can use that for testing. Many developers keep an old used iPod Touch around for just his purpose.
People with devices running something older than 3.1.3 are not only a really tiny percentage of the installed base, but are very unlikely to be still buying apps for that device. Even large developers with staff and legacy hardware available for this testing rarely waste the time on this market.
Look into Project -> Edit Project Settings -> iOS Deployment Target: 3.13. And then build?
Edit according to comment: You still need to ENSURE your code is within the runtime scope, i.e. do checks like 'respondstoselector' before calling methods in question.

Running an older iOS version in the iPhone simulator

I want to test my application on older iOS versions. I am using weak linking for new frameworks and branches in the code for different OS version. But after some complaints from users running iOS 3.1.2, I need to do some testing myself. I don't have a separate iPhone for every iOS version.
So, how can I run an older version of iOS in the iPhone simulator?
That's a really basic question and there might be a duplicate somewhere, but I wasn't able to find it. Any help is much appreciated.
If you can download (or have a backup of) the older SDK that relates to the older OS you want to run on, I believe the general advice is to install the other SDK to a different path (say, Developer/olderSDK and this way you can have both SDK's (and simulators) installed side by side.