Skip to content

Tag Archives: Xcode Programming

10 Things You Need Before You Write An Apple App

How do you go about writing an app? In fact, what do you need before you being app development? Well, that’s where this article will help. I’ll provide you with 7 things you need before you start writing your Apple app. Even if you’ve never developed content for a mobile device, or if you’re new to software development, you should know that learning iPhone development can be a fun and rewarding experience.

Continue Reading: 10 Things You Need Before You Write An Apple App →
7 Steps to Turn Your Idea Into a Real iPhone App

You’ve got your idea of your app, haven’t you? Although it may be a great one, you still need to work it out to make your very own iPhone app. This article is going to show you how to turn your great idea into a great iPhone app through 7 steps.

Continue Reading: 7 Steps to Turn Your Idea Into a Real iPhone App →
Accessorizer 2.0 is out!

Accessorizer by Kevin Callahan is one my absolute favorite utilities, as I’ve mentioned before. Well, now, there’s a new reason to love it. Kevin just released 2.0 over the weekend. And there’s great news for those of you who have bought previous versi…

Continue Reading: Accessorizer 2.0 is out! →
Testing 3.x Apps on Phone Running Beta OS

Like many iPhone devs, I have more than one device that I use for testing. I have an iPod Touch that I usually leave at the current release version, an iPad WiFi that I leave at the current release version for the iPad, and I have an iPhone 3Gs that I keep on the bleeding edge beta release version. This way, I have a device to test and run stuff under the beta SDK and under the release SDK, and I keep both installed on my machine so I have the ability to check out and learn the next release of the SDK while still creating applications using the current release of the SDK.

Normally, this is a perfectly sufficient setup for my purposes, but today, it wasn’t. I have a problem I’m trying to debug that happens when running on EDGE or on a really slow 3G connection; it never happens under WiFi. I’m doing a fix for a client that will need to go onto the App Store long before 4.0 goes GM, so I need to be working under 3.1.2.

In order to try and reproduce this problem, I have to be able to run the app on my phone because the iPod touch and iPad both only have WiFi connections so, therefore, I can’t reproduce the problem there. I don’t want to build against the beta SDK because this is a bug fix on an existing app, and the beta install doesn’t include the current release SDK that I needs to build under, so I can’t build a 3.1.2 app using the beta tools. This is probably done to discourage people from building apps for the App Store with the beta tools (which you really, really shouldn’t do). The only problem is, OS versions have to match between the tools and phone, so I can’t launch the GM Xcode and and debug apps on my iPhone on which I’ve installed the beta OS and if I run on my iPod touch, I can’t reproduce the problem I need to debug because it doesn’t happen under WiFi.

There’s actually a solution, which is to create a symbolic link from SDK in the GM tools folder to the beta tools folder. So, in my case, I have GM tools installed at /Developer and the current beta release installed at /DevBeta. In order to compile a 3.1.3 application so I can test it on a phone that’s been upgraded to 4.0, I can drop to the terminal and do this:

sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk 

If I need to to run and test an application with a base SDK of 3.0 on a phone that’s been upgraded to 4.0, instead I do this:

sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk 

Do this with Xcode closed, then when you re-open your project with an older base SDK, it should work. All we’re doing is creating a symbolic link from the beta tools directory to the appropriate SDK in the GM tool directory.

Now, be aware, this action is likely to be frowned upon by the Mothership; they excluded those SDKs for a reason. But, I haven’t disclosed anything about the beta release other than its existence, which is widely known, and there are valid reasons to use the beta tools and the GM SDKs, so I though it worth sharing. Caveat emptor – do this at your own risk and don’t get mad at me if it causes problems.

©2008-2010 Jeff LaMarche.
Continue Reading: Testing 3.x Apps on Phone Running Beta OS →
Validate Build Product

In the last post, I mentioned Xcode 3.2’s new Validate option that runs the same checks the App Store Review Team will use before looking at the content of your app and which may be used by Build and Archive (or any other Build command, for that matter), I probably should have mentioned what determines whether it will get run. It’s your project settings. To turn it on or off, select Edit Project Settings from the Project menu, and it’s under the Build Options, and it’s just a checkbox you can turn on or off.

Screen shot 2010-05-01 at 10.14.00 AM.png

I would recommend not waiting until App Store submission to run validate. Do it before you send to testers or to your client. It will allow you to address problems before your app gets tested, reducing the need for regression testing.

©2008-2010 Jeff LaMarche.
Continue Reading: Validate Build Product →
Xcode 3.2: Build and Archive

One aspect of iPhone development that I’m no big fan of is ad hoc distribution. In Xcode 3.2, Apple added a new feature to Xcode that makes ad hoc distribution more than a fair bit better. But, for the first few weeks of using Xcode 3.2, I didn’t even notice this item. I know many of you probably have, but I’ve talked to enough people that also missed it, that I figured it’s worth a short post.

This new item lives under the Build menu, but frankly, I don’t use menus much in Xcode. I use a very custom set of key bindings and have all my regular tasks’ key commands memorized. The new option is called Build and Archive.

I still wish Apple would get rid of the whole process, but it’s unlikely they will in the near future. In light of the situation, this makes life much, much better. It’s a pretty good compromise between Apple’s desires and the needs of developers, all in all.

Build and Archive builds your application, code signs it, and stores the application folder along with its symbols file (which you need to decode crash logs generated by ad hoc or release builds). Xcode’s Organizer window gives you ready access to any previous build, and lets you e-mail an ad hoc build packaged up as an .ipa file with the mobile provisioning profile you compiled with embedded right into the application. This allows your clients or tester to simply drag the generated .ipa file into iTunes. The organizer will even generate an e-mail with the .iap embedded in it.

Screen shot 2010-05-01 at 9.43.08 AM.png
Screen shot 2010-05-01 at 9.45.42 AM.png

As part of Build and Archive, Xcode checks your application to make sure it’s code signed and provisioned properly. It may also (depending on your project settings) automatically run the new Validate feature that checks to make sure your application is valid for app store submission. This is the same check that the app review team will run on your app before actually looking at it. The details of what Validate checks are not documented, but in general terms, it will make sure everything is okay and that you haven’t used anything you shouldn’t have used. It’s not a guarantee that your app won’t get rejected because there’s still the manual review for content and HIG, but if your app passes validation, that’s one less possible obstacle between you and the app store. In other words, make sure you validate your apps before submitting them.

One thing to note, however, is that when you use Validate for ad hoc builds instead of building for submission to the app store (and I recommend that you do so that you find problems before testing rather than after), your app may fail one of the Validate checks. If you get this warning message when using either Build and Archive or Build and Validate with an ad hoc build:

warning: Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate. (-19011)

You might be fine (assuming you received no other warnings or errors). The difficult thing is that this warning can be generated by more than one specific problem, so there’s no way to know for sure whether this needs to be addressed other than to try and install the generated .ipa file on a non-development phone. You may (will?) get this warning with ad hoc builds even if the build is fine because you don’t use an “Apple submission certificate” for ad hoc builds.

One of the best things you can do is to have a second iPhone or iPod touch that’s not used for development (ever) that you can use to test ad hoc distributions. Even a second-hand, cheap iPod touch is sufficient since all you’re testing is that the install works If you do this, make sure you add the UDID of this unit to your ad hoc distribution profiles, but not to your development profile.

When you see this warning with Validate when building using an Ad Hoc Distribution configuration, don’t panic, but do try and install it on a machine that doesn’t have your development profile installed before sending it to a tester or client.

©2008-2010 Jeff LaMarche.
Continue Reading: Xcode 3.2: Build and Archive →