iOS 4 Build SDK - iphone

I installed the iOS 4 SDK yesterday. I previously had the 3.1.2, 3.1.3 and 3.2 SDKs installed. Since installing the iOS 4 SDK, I only have 3.2 and 4.0 available in Xcode. When I load an Xcode project that was targeting an older version (say 3.1.2), it says "Base SDK Missing" in the toolbar.
I've been able to reset the project to target iOS 4 instead - and have successfully built. However, I need to do some ad hoc builds for users who may not have iOS 4 installed on their devices yet. If I give them a build that was done for iOS 4 (not using any iOS 4 features - it's the same code I used to build with 3.1.2), will this execute on their device ok?
Unfortunately I don't have any non-upgraded devices to test this on myself!
Thanks,
John

To target older iPhone OS's with the new iOS 4 SDK, Select your XCode project -> Get Info, and then select "iPhone Device 4.0" as the Base SDK, and then select the lowest iPhone OS version from iPhone OS Deployment Target that you need to support with your ad hoc app.

You needed to install XCode beta to an alternative folder /DeveloperBeta (for example) and use the stable xcode for older SDK builds.
You can still do that actually.

Related

Launching Xcode 4.0.2 application on iPhone/iPad from VMWare

I would like to test an application on my iPhone and iPad.
The iPhone is running 5.1 and the iPad is running 5.1.1
I am getting this error:
Xcode cannot run using the selected device. No provisioned iOS devices are available with a compatible iOS version. Connect an iOS
device with a recent enough version of iOS to run your application or
choose an iOS simulator as the destination.
I have a developer's license and have followed the provisioning wizard in the Apple website members section. I've installed everything like it said (certificate, provisioning profile in keychain, etc..) but am still getting this error.
I've tried compiling it on 4.3, 4.2, 4.1, and basically all of the options that are available in the build section.
In the Xcode Organizer, my devices show up with an Orange icon next to them. This is the 'error' message on this screen:
The version of iOS on “Personal iPad” does not match any of the
versions of iOS supported for development with this installation of
the iOS SDK. Please restore the device to a version of the OS listed
below, or update to the latest version of the iOS SDK; which is
available here.
This is all on VMWare on OS X 10.6.7.
I've read the other posts where people had a similar problem and tried the solutions proposed (which were mostly comprised of trying to run on older builds) and nothing worked so far.
Notice how you are compiling with an SDK version less than the version on your devices? That's a problem. For iOS 5 you need at least Xcode 4.2 (which comes with the 5.1 SDK).

Unable to run simulator for iPhone3GS from xcode3

I'm unable to run simulator for testing iPhone3GS below version of 4.0. I have built my app with xcode4 and now, I want to test it how it works in iPhone3GS. I have read that I should install previous version of xcode, so I have installed xcode3. My IPHONEOS_DEPLOYMENT_TARGET is set to 3.1 in projects settings (xcode3). But still I can't see any iphone versions below 4.0 in simulator select list. What am I missing?
Well first of, the latest version of Xcode 3 only comes with the iOS 4.* SDK so there is no iOS 3 simulator.
You will need to installe a version of Xcode 3 with iOS 3.* SDK to get the 3.* simulator, but you can only get them in de bundle version of Xcode.
What I do is test my apps on a device running iOS 3.1.2 with Xcode 4 and dropping support for iOS 3.* in new projects (94% of my user have switch to iOS 4).
in this case you have to click the target section of the xcode and thre you have to chage the setting >build>latest ios.
You can make and add hoc build and install it on an real device that run the desired os version.

How can I build an application for iPhone OS 3.1.2 using the current Xcode?

I have an iPhone running the 3.1.2 firmware and would like to build applications for it. However, I can't find Xcode 3.2.1 with the iPhone OS 3.1.2 SDK at Apple's developer site.
How can I build an application using the current SDK and Xcode versions that will run on this older OS version?
Use the current tools and SDK. Set the "Base SDK" build setting to "Latest iOS" and set the "iOS Deployment Target" to whatever version you want to target, such as iOS 3.1.2.
The only gotcha here is that the compiler won't warn you if you use something from the SDK that was introduced after iOS 3.1.2, and if you do your app will likely crash. So, you'll want to check the docs for each method you use that you don't already know for certain is available in 3.1.2, and you should test your app thoroughly.
Unless there is some unmentioned reason you need the older version, you can use the latest Xcode and just target the build for the old iOS.
If you are a member of the Apple Developer Program (which you need to be in order to download any version of the Xcode and iOS SDK), you can download Xcode 3.2.6 w/ iOS SDK from the main 4.3 from the iOS Dev Center home page. Under the section for Xcode 4, there's a small line saying "Looking for Xcode 3? Download", which takes you to this download page.
Of course, that still requires you to develop using the 4.3 SDK, so you have to be carefull when targeting 3.1.2 devices.
You can purchase Xcode using the Mac-App-Store or by subscribing to the iPhone Developer Program ($99 per year).
Get the latest one (XCode with iOS SDK 4.3) and select 3.1.2 for the deployment iOS Version (under build-settings).

Upgrading iOS SDK

I've XCode 3.2.3 with iOS SDK 4 installed in my iMac. I bought an iPhone 4 with OS version 4.0.2 and I would like to use that device for development. However the Organizer shows the message below when the device is connected.
The version of iPhone OS on “iPhone 4G” does not match any of the versions of iPhone OS supported for development with this installation of the iPhone SDK. Please restore the device to a version of the OS listed below, or update to the latest version of the iPhone SDK.
Currently my XCode supports Base SDK from 3.0 to 4.0.1.
So if I download the latest XCode 3.2.4 with iOS SDk 4.1, will I still have Base SDK support from 3.0 ?
Cheers
Jugs
No, XCode 3.2.4 does not come with SDK 3.0, it comes with SDK 3.2 and 4.1. But you don't need the 3.0 SDK to write apps that will run on 3.0.
There are two versions that are important to you as an iOS developer, and you need to understand them: first, there's SDK version that you link to, this is the Base SDK. It should normally be set to the newest SDK available.
And then, there's the Deployment Target. That is the earliest version your app needs to run on. This is the one you are actually caring about, this one ensures that your app will still run on earlier iOS devices.
To set that, go to "Project -> Edit Active Target". In the dialog, select the "Build" tab, make sure "Show" is set to "All Settings" and the type "deploy" in the search field. Scroll down to the "Deployment" section, the last entry should be "iOS Deployment Target". You need to set this to "iOS 3.0" or whatever suits you. You should now get warnings if you use methods or classes that are not available on 3.0.

How to make my iPhone app compatible with iOS 4?

My iphoneos 3.1 based application is not working on iOS 4 GM: the camera is not showing in full screen, it doesn't correctly detects compass information, the uiwebviews doesn't respond to touches (they don't scroll), and so on. It's completely broken! Now my question is: how can I develop an update using the latest xcode with support for ios 4? The latest iOS 4 xcode (3.2.3) doesn't provide any way to develop for iPhoneOS 3.x ("base sdk missing"). By the other side, xcode 3.2.2 would not allow me to debug it on a iOS 4 device, so I can't test it.
In Xcode, you can use a later base SDK while targeting an earlier version.
Go into your project settings and set iPhone OS Deployment Target to an earlier version, such as "iPhone OS 3.1".
I would create a second disk partition and install the 4.0 version of xcode on that. Keep the 3.2 version on your primary drive.
Its probably not necessary to create a second disk partition but it was simple to do.
Install the 4.0 sdk under a different folder and then re-install the 3.2 sdk and develop in that.