Updating iPhone application from 3.0 to iOS4 - iphone

I was just wondering if anyone knows of any articles relating to upgrading an iPhone application from 3.0 to iOS4. (Thanks for this iWasRobbed).
While the application still runs on iOS4, it will not run on the iPhone 4, but does on my iPhone 3G.
When I deploy the app on the iPhone 4, the Default screen loads and it will sit there hanging. The only inclination towards a problem I get is this warning:
warning: UUID mismatch detected with the loaded library - on disk is:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/Frameworks/UIKit.framework/UIKit
warning: UUID mismatch detected with the loaded library - on disk is:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/PrivateFrameworks/DataAccessExpress.framework/DataAccessExpress
Thanks
James

James,
Apple has provided this checklist: http://developer.apple.com/iphone/checklist/
It generally should not be that big of an issue. Typically, you just set the baseline SDK as 4.0 and the deployment target as either 4.0 or something 3.0+.
If it is not running on an iPhone 4, you may wish to explain further what specifically it is doing or not doing when you attempt to run it on that device. Keep in mind that all apps (for the most part) that were designed to run on 3.0 and above will typically run well on an iPhone 4.
There might be some issues with deprecated methods, so make sure you resolve those prior to installing and running the app. You should get a compiler warning for any of those, if not check your target settings and there should be a checkbox for it.
Other than that, I'm not sure what else would prevent you without understanding further details of your project.
As additional information, you should really look into the WWDC 2010 video called "Future Proofing Your Applications" (watching it now :)

That is most likely a mismatch between what iOS your iPhone 4 is running and what SDK you're using in Xcode. The UUIDs are mismatched because the iPhone 4 is using a different version SDK to what you've coded in.
Solution, install the latest SDK and make sure your iPhone matches this. The latest out is 4.1

I had the same problem and think I have solved it because the problem has gone away.
Firstly I deleted the build folder. Then I Installed the latest version of ios (4.1 in this case) onto my iphone through itunes. Afterwards i installed the latest xcode and iphone sdk package from the apple devlopers site.
This in itself probably fixed the problem but just to be sure I added a new provisioning profile for the phone on my computer and everything worked great afterwards.
Hope that helps

Related

Testing on iOS 3.1 simulator

iOS project. Base SDK 4.2, deployment target 3.0. A customer is complaining about an issue on iOS 3.1 (he has an old device).
I tried installing Xcode 3.2.3 - the oldest there is for download. It does not offer iOS 3.1 as a test target. Does anyone know how can I enable older versions of iOS on the simulator?
The box also has Xcode 4 (in a different folder). Could it be the case that they're sharing the iOS simulator, and the backwards-incompatible one from Xcode 4 is getting in the way?
There is no substitute for testing on a real device.
I've had a problem with my iPod touch (3rd gen, ios 5.0) crashing in one app. Every day. The dev won't buy, beg, borrow or steal a real iPod touch to test it on so he can fix it. As a user this is extremely frustrating.
EDIT:
The final versions of Xcode with the iPhone SDK, as it was called then, are not available from Apple's download page, but the direct links still work.
The direct links can be found at:
http://chris-fletcher.com/2010/08/28/howto-install-iphone-sdk-2-0-3-1-for-xcode-3-2/
If you use the latest Xcode, you can install device debugging support via the Downloads->Components section, a la: http://cl.ly/3U1V1G3W2p2E1G29342e
http://iphonesdkdev.blogspot.com/2010/04/old-versions-of-iphone-sdk.html
Some of the links are dead though. Apple is removing those old files little by little. Get them while supplies last.

I am using Xcode 3.2.5. I have iAds running. Confused about about targest, iOs versions

Trying to keep up with the curve. I'm reading almost too much and is sending me in a tail spin. Is there a one stop link which will tell me what my target should be to run my app on all platforms based on what frameworks I have included? I make heavy use of Mapkit, and want to include iAds. My current apps seem dead on 3G.
Does Apple force you to support only the latest iOS? I have no problem with that, but not sure if someone who has and ancient 3G, how do I tell them, NO I don't support your phone, please upgrade?
Set your project's base SDK to the latest version of the SDK. Set the deployment target to the oldest version of the OS that you plan to support. You can use features introduced in versions later than your deployment target, but you'll need to check for them before you use them, else your app will crash.
Read the release notes for each version of the OS to get a good idea of what features were introduced when. In fact, make it a habit to read the release notes thoroughly each time a new version comes out.
iOS 4.2 runs pretty well on an iPhone 3G, so there's no need to drop support for the 3G anytime soon. If your apps currently don't work on the 3G, fire up your debugger and figure out why. What version of iOS are you running on that device? Where does it crash? This is typical debugging stuff.

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.

Testing in iOS 3.1.3 with the latest Xcode

How do you test an app in iOS 3.1.3 with the latest Xcode build?
Is it possible to do this in the Simulator? If not, is it possible to downgrade a device to iOS 3.1.3?
Yes, you can downgrade a device. It is not officially supported but I've done it on two 3Gs with success for testing on 3.1.3.
First find a tool called RecBoot by someone called the0rkus, runs on Intel macs only. This brings the phone out of recovery mode once you have loaded the 3.1.3 software.
Find the .ipsw file for your device, as you know it is a different file for iPhone 3/3GS or iPod Touch. Load this software to the phone via iTunes in the usual way, holding the option key while clicking "restore". Wait while it loads.
When it finishes and reboots you will find iTunes complains about this version being incorrect. Situation is the software is loaded, ready to go, but it lacks the final blessing from Apple. RecBoot brings it out of this mode, "waking" the phone into normal ready-to-activate state. Once you have gone through connection to iTunes with a SIM inserted you have a phone just as if you had never gone to 4.0.
Too bad we have to resort to a hack to test with older devices but I don't know any other way. It would be nice if the simulator could still run 3.1.3, nice if setting deployment target would flag pre-3.2 features.
You can also install the older Xcode 3.2.1 with iPhone SDK 3.1.3 but the hardware is the true test of whether your software really works. Given that, you could probably skip finding and using it - although there is no quicker way to find everything that you can't use in 3.1.3. There is no problem having multiple copies of Xcode of different versions installed but it is a good idea to uninstall them with the script provided in /Developer/Library/uninstall-devtools (read the readme included with each Xcode distribution)
You need to test the app on a device running 3.1.3.
The deployment target is one thing (that you set to 3.0 so that you can test on the device)
But if you are looking debugging with a specific version of the SDK, you should have the respective XCode installer.
Does your simulator have a menu marked "hardware" with a variety of older OS version choices?
(Mine does.)
Just use that.
It won't be 100% "actual device" test... but it's a WHOLE lot easier.
(None of the simulators are 100% tests anyway.)

Developing for 2.2.1 SDK on Snow Leopard

I’ve installed Snow Leopard, have Xcode 3.2 and 3.0 iPhone SDK. I want my applications to run on 2.2.1, but the SDK is nowhere to be found in Xcode. I’ve set the deploy target to 2.2.1, but still I cannot be sure I am not using any 3.0-isms. (I’ve sent a sample application to my friend who still has 2.2.1 and it does not run, so it looks I really do use some 3.0 specific API.) How can make sure that my applications will run on 2.2.1? (Simulator also lists only 3.0 as version option.) I’d hate to check my sources manually for every call that might not have existed in 2.2.1.
See my question.
However, I think this is a bad situation that Apple has created for us. There really is no way to test against 2.x.x, if you, like me, have no iPhone 2.2s to test against. I actually bought a new 3Gs just so I could use the old 3G for testing. Stupidly though, when iTunes came up one day and asked if I wanted my phone updated to 3.0.1, I said yes, without realizing which phone I was updating.
I have tried, to no avail, to downgrade to 2.2.1, doing all the things like holding the home button and power for 10 seconds, etc., but I keep getting a baseband loading error.
I know Apple is trying hard to push everyone to 3.0, but not having the stats on how many users are still on the older OS, it seems prudent to keep supporting that OS. They should at least have kept 2.2.x support for the Simulator. I hate to release a 2.2.1 app based on whether I think I am using 3.0 calls or not, without actually testing it on 2.2.1.
OK, SDK 3.1 was released yesterday (September 9) and also contains SDK 2.2.1. You cannot build for the Simulator, only for the device, but most of the glaring 3.0-isms will appear as compile errors, which makes testing much easier.
Uninstall the SDK or Developer folder completley.
using Terminal execute: /Library/uninstall-devtools --mode=all, then restart, re-install new SDK.