Categories
ios Mac OS X

Xcode 4.3.2 on OS X Lion fails to deploy app to an iPhone on iOS 5.1.1

A seriously frustrating and naturally time-consuming issue paralyzed me today.

Apple recently released the iOS 5.1.1 update to its mobile devices. Sounds minor and it probably was. But 5.1.1 also signaled the end of life for using OS X 10.6 Snow Leopard for developing for newer OS versions. Snow Leopard supports devices with iOS up to 5.1. Yup, not 5.1.1. Just 5.1. Not much of a heads up but well – time to move on to Lion. So I do.

Today came another surprise. The most current release version of Xcode – 4.3.2 – did not appear to enjoy my iPhone and its iOS 5.1.1. Organizer saw the device, added it to the provisioning portal team (removed, added, removed, added, etc.) and added and removed the provisioning profile for the app. Still, Xcode would fail to recognize the device and stick with the blank 'iOS Device' in the execution scheme.

Finally, I stumbled across this post in Apple's Developer Forum:

"The latest Xcode for Snow Leopard is 4.2 and that appears to be the highest it will go. 10.6.8 is required for iOS support.

The latest Xcode for Lion as of 5.7.2012 is 4.3.2, which requires 10.7.3 and is needed to work with iOS devices at iOS v5.1.x – v4.3.2 is an application that will be installed to your /Applications folder. Xcode 4.3.2 comes with 5.1 SDK and supports iOS 5.1.1…connect your device and let Xcode download 5.1.1 symbols."

The part I seemed to be missing seemed to be the "let Xcode download 5.1.1 symbols".

Further digging on StackOverflow had the answer: essentially power cycle your iOS device and THEN reconnect it to your Mac. Let iTunes start up and finish its scan of the device. Then close it and start Xcode. I ended up also restarting my machine. I then created a NEW project and had it detect the iOS 5.1.1 device successfully.

Still, I am unable to get projects that were created before 5.1.1 came out to detect the device. Luckily nothing is major there but this is clearly a rather grim bug in Xcode.

Share
Categories
Computing ios mobile

XCode iOS simulator is case insnsitive. iOS on Device is not.

We have an iPad app. We load images using file paths into the app. Images appear just fine in the iOS simulator. Images do not show up on the device. Fist shaken madly in the air, agony.

Thanks to my colleague Dolphy Fernandes we managed to discover the culprit. The iOS Simulator used by XCode loads file in a case insensitive manner. To it, a file called A55.jpg and a55.jpg are the same. iOS on devices, on the other hand, is case sensitive. Hence, A55.jpg will not load if the file name you are attempting to load is 'a55.jpg'.

Hope it helps…

Share
Categories
ios iphone Mac OS X

Xcode: “No match for certificate/private key” error and resolution

An app we were building for the iPad was recently approved by the client. Being a more capable organization, the client wanted us to build the app for them using their Apple developer and app store credentials for submission. To do that they sent us the three necessary files:

  • Public Key (Distribution)
  • Private Key (Distribution)
  • Mobile Provisioning Profile (Distribution > AppStore)

I also modified the app's bundle identifier to reflect the identifier specified by the client.

I merrily added the keys and certificate to the OS X key chain. Yet Xcode was unable to build using these updated credentials. The error that was reported was:
"Profile does not match any valid certificate/private key pair in the default keychain"

After digging around I pinged my friend Glenn Martin from Intrepid Development to see if he knew what was wrong. Glenn actually knew what went wrong: apparently OS X 10.6.8 imports keys to the System key chain instead of the Login key chain. Xcode only looks at the Login key chain. All the was necessary to fix the issue was to drag and drop the key in the Keychain Access application from the System key chain to the Login one. Mindless fix to a truly frustrating problem.

Hope it helps you.

Share
Share