Friday, 09 October 2009
1 comments iPhone Mac When I set my Mac Mini for iPhone development, I was told to backup a key file (.p12) because if I lost it and needed to reinstall, I wouldn't be able to deploy to my iPhone (yikes!). I backed it up as suggested, and made sure I had copies of it all over my Mac, PC and the interwebs.
With a clean install of Snow Leopard, it was time to import this keyfile and make sure everything still worked. As instructed in the docs, I double-clicked on the .p12 file and was asked for the password. I entered it and got the following message:
An error has occurred. Unable to import an item. The contents of an item cannot be retrieved.
Oh, shit.
I tried multiple times to import, and even imported other keys I'd exported before it. I'm 100% sure I was putting the password in correctly. No joy, just lots of errors. Although the key appeared in the list (after apparently failing), Xcode refused to recognise it and I'm unable to deploy to my iPhone. This was looking pretty bad...
Google to the rescue!
After a bit of searching, I came across a post from someone having the same issue, and a workaround. Importing via the terminal apparently works. I gave this a shot, and all is good. I can now deploy to my iPhone again. Thanks Dave K!
Just in case you're reading this with the same problem and the link above is now broken, here's a copy of the solution:
Work-around provided by Dave K.
You can use the 'security' command line tool:
security import priv_key.p12 -k ~/Library/Keychains/login.keychain
security import pub_key.pem -k ~/Library/Keychains/login.keychain
Friday, 07 August 2009
3 comments iPhone Mac I'm shaking my head with shame. I never thought this day would come. I'm writing a blog post... from a Mac!
Those that know me will probably know I'm a massive Microsoft fanboy. I love .NET, XNA, WPF, Visual Studio, Vista and all the other things that come from Redmond. I don't like Apple.
Last year I bought an iPhone. I just couldn't help myself. I've had many Windows Mobile devices from iPaqs to XDAs and they suck. Big time. The iPhone came along and it just wiped the floor with anything out there, so I had to get one. I love it!
Months on, and I've released an Xbox game called Jungle Blocks using XNA. The whole process was pretty awesome. I got to write it in Visual Studio using C# and for very little money my game was out there being played by other people. They were paying money to play my game. That was a cool feeling!
Then my mind started to wonder... Maybe I should dabble in iPhone development? I could release iJungle Blocks! (Ok, maybe I won't call it that). In a lot of ways the App Store seems to work very similar to XNA and the Indie Games and since I'd already filled in all the forms and got an ITIN I figured I didn't have much to lose trying.
Well, except my pride. It turns out that Mr Jobs doesn't want you making money from his iPhone if you don't have his computer. You can only develop for the iPhone on a Mac (legally). This was a bummer. Macs stink. They won't do .NET and they certainly don't do Visual Studio. It was time to do some research!
I started browsing the web and speaking to a few people to find out what coding on a Mac would be. This is what I found out:
- The cheapest new Intel Mac is £500
- Xcode (the Mac IDE) is crap. It does not have all the features of Visual Studio 2008 :(
- Objective-C is verbose and long-winded. There is no Garbage Collection!
- All my friends will laugh and point if I buy a Mac
Things were looking grim, but I decided to go nuts. This week, I bought a Mac Mini. After a few hours I discovered a few more things:
- Mac keyboards suck. Thankfully my Microsoft Keyboard/mouse works :)
- I can't type " @ or #. They're just mapped wrong.
- The Mouse on a Mac starts slow and then accelerates veryquickly. It's a pain in the ass.
- Alt+Tab is Windows+Tab. Ctrl+C is Windows+C. etc. This is madness!
- The Home and End keys don't work as expected. Neither do Ctrl+Left or Ctrl+Right.
I got Xcode installed and started playing around to see how bad this thing was. After a few nights of wrestling with Xcode, Objective-C, Cocoa-Touch and Mac OSX here's what I've found out:
- Xcode is not crap. There's still time, but Xcode is not frustrating the hell out of me like I thought it would. It's not all that bad. Nowhere near as bad as some of the crap I've had to use (I'm looking at you, FlexBuilder). I might just get on with it!
- Microsoft have Mac drivers for my Microsoft Keyboard and mouse. They not only fix the crazy mouse acceleration, it includes a proper mapping to fix " @ and #!
- Even on the highest setting, the mouse still moves too slow on a Mac. The max setting on a Mac doesn't come close to the Max setting on a PC.
- Cocoa-Touch is actually really nice :)
- There is no nice fix for Alt+Tab. I can swap Windows/Alt keys, but then Copy/Paste becomes Alt+C/Alt+V instead of Windows+C/Windows+V.
- These is seemingly no fix for Home/End/Ctrl+Left/Ctrl+Right
So far, things are not as bad as I imagined. And the Mac does have some nice stuff. But will it tempt me away from the lovely world of Visual Studio and C#? Unlikely. It's not as bad as I expected it to be, but it's just not the same experience as developing on a PC.