I am stating a new Universal App, but want it to also work on an iPad 1 (people like myself still have one).
I am developing on Xcode 4.5.2 which defaults to IOS6, but when I set the Target to IOS5 and run, it crashes (black screen).
Any suggestions on how to target IOS5 while developing on a later IOS version ?
Your question really should be: "Can apps still support iOS 5". The iPad part is largely irrelevant. It's just that the iPad 1 can't be upgraded past iOS 5.
The short answer is "yes".
However, you must use Xcode 5 because your app must fully support iOS 7 and this requires Xcode 5.
With Xcode 5 you can set your project's "Deployment Target" all the way back to iOS 4.3. Though there is little point to that. If you want to support iOS 5 then set the deployment target to iOS 5.
Of course you need to avoid many things such as auto-layout and you must do proper checks to avoid using classes or methods that don't exist in those earlier versions.
Related
I released an iOS 8 version of my app today and wanted to limit it only to users running iOS 8 (because it uses some new Core Motion APIs that only work with iOS 8). It seems like iOS7 users are still able to download my app, even though the deployment target is iOS8 and the App Store says "Compatibility: Requires iOS 7.0 or later". Can I force app to run in iOS8 only? Does the Deployment Target option in Xcode still control which version of the OS is required on the App Store?
The answer is, you have to set the Deployment Target in three different places, in the project, in the app target, and (in my case) in the extension. If you don't set it in all three locations the app won't show as iOS 8 only.
Deployment target on all your TARGETS is the correct option. It's important to understand the different between "Deployment target" and "Base SDK". Both regard a iOS SDK version, but they have different meanings. To learn what read here.
What exactly does iOS 7 use to determine whether the application should be displayed with the traditional iOS 6 style UI (aka iOS6 compatibility mode), or the newer iOS 7 UI?
If I build our app in Xcode 5, with base SDK set to 7 I get the iOS 7 UI as expected
If I build our app in Xcode 5, with base SDK set to 6 I still get the iOS 7 UI (unexpected, happens on real device and simulator)
If I build in Xcode 4.x, I get the older UI as expected
In all cases, the deployment target is set to 5.
Since our app has fairly custom UI we're not ready to move to the new look of iOS 7 yet. However we do need to make some backend changes to support iOS 7 which we need to release now. Can we still submit apps built with Xcode 4.x and expect them to be accepted?
For the time being, you are able to. Apple will make an announcement when they stop accepting apps built with Xcode 4.x. My company is currently submitting apps with Xcode 4.6 since we do not have a new enough operating system for 5. I suspect it will be at least a few months until they stop.
Running against 6.1 Base SDK should do it.
However, as I discovered yesterday. Anything less than 7.0 Base SDK isn't supported by Xcode 5 (officially) and so it is undefined behaviour.
My app suddenly switched from iOS6 UI to iOS7 UI with no code changes.
In the end I restarted my mac and phone, deleted the app, deleted derived data and reinstalled cocoapods and it was working on iOS6 UI again.
Make sure that you set the Base SDK to iOS 6 in both the Project build settings & the target build settings - that should do the trick. Even though the target settings are supposed to override the project, I found that when just the target was set to 6 - it compiled with 7.
Regarding XCode 5, it's true that it doesn't officially ship with the iOS 6 SDK. However, you can extract it from XCode 4.6 and use it in 5.
You'll find the SDK in the XCode app under:
Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
Simply copy it from an existing installation of XCode 4.6 or from its .dmg (which can still be downloaded from Apple's website) to the corresponding folder in XCode 5, restart and you should now be able to select it as the Base SDK. Note that you'll have to do this after every update of XCode so you might find it easier to use a symbolic link rather than copying.
We've successfully submitted apps built this way to the App Store although as has been said before me, it would be a good idea to transition to iOS 7 ASAP before Apple makes it compulsory.
Maybe it´s a really stupid question, but how will my app look on previous versions of iOS if I make it with the new Xcode? It looks good in the simulator, but thats just showing ios7. I have made some design changes to fit ios7 and since the toolbars and navBars had to be moved it feels like it will look awful in ios6 for example.
Maybe will your app look good on older versions. But that depends on your code. You have to test it.
You can install your app on a older iOS version by setting the deployment target in the general tab.
After that, you should be able to run the app on older iOS simulator. This should look like this
If there is still only the iOS 7 simulator, than go ahead and hit more simulators to get more.
Having installed Xcode Version 5.0.1 (5A2053), the More Simulators option is no longer present. The Components tab on Xcode Preferences/Downloads only offers the options of 6.0 and 6.1. The release notes don't say that anything's been removed, but I can't find how to reinstate pre-6 simulators.
[Further note] In the iOS Simulator user guide, there's a section on iOS Version Limitations that seems to imply that even 6.0 might disappear without notice - "iOS Simulator does not have complete backward compatibility. In addition to supporting iOS 7.0, iOS Simulator supports iOS 6.1". Worrying if you still have apps that target 5.0 or 5.1.
How is it possible to use your pre-iOS 7 look and feel for your app? I just upgraded to iOS 7 and I have some apps on the phone that are still using the pre-iOS 7 look and feel. For instance one app is using the old UIPickerView look but it's running on iOS 7.
When I tested running the app that I am developing on the iOS 7 simulator it's using the new UIPickerView "automatically" without me doing any changes.
So I'd rather that my app uses the pre-iOS 7 look and feel until I have upgraded my app for iOS 7.
Here's an image of running Checkmark on iOS 7, you can clearly see it's using the pre iOS 7 keyboard:
That's rather simple: You have to build your app using the iOS6 SDK. iOS 7 detects older apps by checking the SDK against which the app was linked.
You can switch "Base SDKs" in Xcode by selecting the target, switch to the build settings tab, and find the "Base SDK" build setting under "Architecture".
If you don't have an older SDK you may need to use an older version of Xcode (4.6). Rob Napier describes here how to point a newer Xcode to older SDKs.
Note that while many UI elements retain their iOS 6 look, some don't (UIAlertView, UIActionSheet).
If you're using the standard UI components you're going to automatically get the new style on iOS 7, there's no way I've come across to force them to appear as they would in iOS 6. The only way you're going to be able to have them appear as iOS 6 elements is to build custom elements and style them yourself, however there's a risk in doing that that when you submit to Apple they'll reject on the basis of breaking the HIG.
On a device running iOS 7, all of the system UI—such as alerts and notifications—uses the iOS 7 appearance, even if your app is currently using an earlier appearance.
From Apple transition guide:
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TransitionGuide/SupportingEarlieriOS.html#//apple_ref/doc/uid/TP40013174-CH14-SW1
Not only do you need to build your app using iOS 6 SDK or earlier, you need to use Xcode 4.6 or earlier. I just went through all of this and targeting iOS 6 SDK from Xcode 5 is just not enough.
Luckily you can dual install both versions of Xcode. Just download Xcode 4.6 and drop it in your Applications Folder and rename is to something else
I still have an iPad 1. I use the latest version of XCode for app development which will only debug apps on devices that run iOS 6.
Unfortunately, iTunes will not allow you to upgrade an iPad 1 past iOS 5. Can XCode be configured to debug apps on iOS versions older than version 6?
Another approach would be to upgrade the device to iOS 6 via jailbreaking. I have read that jailbreaking an iPad 1 will give you a path to upgrade it to iOS 6, but I haven't found anything specific to development.
EDIT
It turns out that this problem only occurs when I create a new app using XCode. However if I open sample code from some existing apps (for example SpeakHere), my iPad 1 suddenly appears on the XCode "run list" and I can test on the iPad 1! I suspect that there is something about these apps that is "old" that causes them to work. Can I simulate that somehow on new apps I build using XCode?
No, you cannot use a first generation iPad for iOS 6 specific development.
You can, on the other hand, use the latest Xcode and iOS 6 SDK, and still use your iPad 1 for debugging purposes. You naturally can't use iOS 6 features, because the iPad is maxed at iOS 5.
To enable this, you can download 'Device Debugging Support' packages, to allow you to do this. Go to Xcode->Preferences->Downloads->Components, and see if it's available.
It sounds like you're just accepting the default deployment target of 6.0 for new projects. This means you won't be able to run the application on older versions of iOS, much less debug them. You need to set the deployment target for your project or target to 4.x.