MacBook Pro is finally a desktop replacement again

I just built a loaded up MacBook Pro for my new job and am relieved to find that, finally, they’re viable as a desktop replacement for development work again! I’ve been using an iMac + MacBook Air combination for the past year or so which worked fine when the bulk of my real productive time was at the iMac and the laptop was just for the occasional meeting and travel, but I’m now at a startup again I really one portable computer that does it all wherever I need it.

Based on the recent benchmarks I figured the late 2011 upgrades would put the MBP in the desktop contention range and I was right: quad core, the ability to finally get 16GB SODIMMs as 2×8 for under $200, and the relative cheapness of a blazing-fast third-party SATA III SSD upgrade (I went for a Crucial M4) makes it come in only a hair beneath a fully-loaded iMac (graphics capabilities aside) for somewhere in the ballpark of $3k. Of course, that’s without a 27″ display – but as much as I still love my 27″ iMac at home I honestly found the extreme glossiness pretty bad under office lighting anyway, and am more than happy to wire up a couple generic 23″ anti-glares for a fraction of the cost!

Overall, it’s a killer machine for doing tons of iOS, Android, and miscellaneous server development side-by side with all the IDE’s open and a pile of devices connected without so much as a hiccup, and as a quiet computer fanatic I love that I really have to go out of my way to push it before I ever hear a fan.


No Comments

Automated iOS Jenkins builds with application tests and Core Data

I recently started some iOS development with a new team and had the chance to set up a server for continuous integration builds. Since our teams are already familiar with Jenkins that seemed like the logical place to start, and the Xcode plugin available works reasonably well out-of-the-box for simply building the application. However, running tests – especially what Apple calls application tests (anything accessing a bootstrapped NSApplication through the simulator) using Core Data – took a little bit of tweaking. Here’s what was needed as of Xcode 4.2.

  1. Install the latest version of Jenkins, either on a Mac with Xcode installed or another server that has such a Mac available as a slave for any iOS builds
  2. Install a plugin for your source control system of choice if not already present (I’m using Git with the default Git plugin - considering the great Git support added in Xcode 4 with Git repos enabled by default, if you’ve been looking for an excuse to switch this is it!)
  3. Install the Xcode plugin
  4. Create a build following the plugin build instructions for a basic release build of the application, and especially pay attention to the keychain notes (I went ahead and entered the login password of the build account so that Jenkins could unlock it itself)
  5. Run a build and verify that everything is successful up to this point, and if not, troubleshoot
  6. Edit the build and add a separate build target for testing following the plugin test instructions, specifying iphonesimulator as the SDK (you can enter a full absolute path like the example if you wish, but simply iphonesimulator should find the latest), and make sure it points to your project’s test target instead of the primary build target (e.g. MyAppTests instead of MyApp)
  7. Run a build and look for errors. Assuming you have one or more application tests expecting to run in the iOS simulator it will probably have skipped all the tests with an error like ”Skipping tests; the iPhoneSimulator platform does not currently support application-hosted tests (TEST_HOST set).”
  8. To fix the error above (or prepare for it, if application tests don’t exist yet but will eventually), on the Jenkins server (or slave if running the iOS build on a slave) edit:
    /Developer/Platforms/iPhoneSimulator.platform/Developer/Tools/RunPlatformUnitTests (if Xcode <= 4.2)
    /Applications/ (if Xcode >= 4.3)

    and change line 95 from:

    Warning ${LINENO} "Skipping tests; the iPhoneSimulator platform does not currently support application-hosted tests (TEST_HOST set)."

    to these 2 lines:

    export OTHER_TEST_FLAGS="-RegisterForSystemEvents"
    RunTestsForApplication "${TEST_HOST}" "${TEST_BUNDLE_PATH}"

    as described in Xcode 4: Running Application Tests From The Command Line in iOS (and if you want to be able to run command-line builds with tests on any local developer environments, like xcodebuild -target MyAppTests -sdk iphonesimulator, this is the step to do on each of those as well)

  9. Run a build again and look for errors. Assuming you have application tests for portions of the application using Core Data, you may see an error relating to the storage URL like “Error validating url for store”
  10. To fix the error above (or prepare for it, if the application doesn’t use Core Data yet but will eventually), you’ll need to change several of the configuration methods for Core Data to operate differently during command-line tests as described in iOS Unit Testing with Xcode 4 and Core Data; not covered here is how exactly to detect if you’re in a test, which I did by checking the WRAPPER_NAME environment variable like this (and I have local data being written inside the generated ./build directory):
    * Determine if application is running from a test inside an external command-line build by xcodebuild.
    - (BOOL) isExternalBuild
        NSString *wrapper = [[[NSProcessInfo processInfo]environment] valueForKey:@"WRAPPER_NAME"];
        return wrapper != nil && ([wrapper rangeOfString:@"octest"].location != NSNotFound);
    Returns the managed object model for the application.
    If the model doesn't already exist, it is created from the application's model.
    - (NSManagedObjectModel *)managedObjectModel
        if (__managedObjectModel != nil) {
            return __managedObjectModel;
        if([self isExternalBuild]) {
            NSArray *bundles = [NSArray arrayWithObject:[NSBundle bundleForClass:[self class]]];
            __managedObjectModel = [NSManagedObjectModel mergedModelFromBundles:bundles];
        } else {
            NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"MyApp" withExtension:@"momd"];
            __managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
        return __managedObjectModel;
    Returns the URL to the application's Documents directory.
    - (NSURL *)applicationDocumentsDirectory
        if([self isExternalBuild]) {
            NSString *dir = [NSString stringWithFormat:@"%@/build", [[NSFileManager defaultManager] currentDirectoryPath]];
            return [NSURL fileURLWithPath:dir];
        } else {
            return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
  11. Run another build and look for errors. If you see a more generic error along the lines of “UISplitViewController is only supported when running under UIUserInterfaceIdiomPad” or messages like “Timed out trying to acquire capabilities data.” during the run, your build server may not have the necessary scheme metadata from Xcode.
  12. To fix the error above, first make sure you’ve checked the Shared checkbox in the Manage Schemes dialog of your project, which will place some additional metadata in the project directory that you can commit to source control (but make sure you don’t then ignore them!) as described in Managing Schemes
  13. If you still see the error the iOS simulator probably has not been launched on the build machine since the last restart; it must have run once to start the necessary services but also cannot be open when the test runs, so to handle this automatically you may want to add a simple execute shell targetat the beginning of your build like:
    open '/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone'
    sleep 3
    killall 'iPhone Simulator'
  14. Run another build and hopefully this one works! If not, post the additional steps required and I will add them to this checklist.
  15. Once everything is working perfectly in Jenkins you’ll want to confirm that you can still run both the application and any test targets successfully in the simulator or on a device directly through Xcode. The steps here should support this unless you’ve missed something.

, , , ,


Remembering Steve Jobs

Steve Jobs passed away yesterday and I’ve been struck by the outpouring of appreciation and remembrance from consumers and the industry alike.

For me, Apple products and culture have always been the pinnacle of why it’s cool to do the kind of work I do, and nobody embodied this better than Steve himself. As a bit of a fanatical perfectionist myself I love that Steve never settled for second best and pushed people hard not to drive them into the ground, but to hone them and their ideas into the very best they could possibly be. But even more importantly he wasn’t just the king of geeks as so many giants in the industry are, but a real consumer’s inventor building things that made computers, the internet, and portable music accessible not just to tech heads like me but to my friends, my parents, and now even my baby.

My connection to Apple and Steve is also a sentimental one. My family’s first computer was an Apple IIgs on which I wrote my first programs in elementary school (yes, in BASIC), and when I got my hands on a Mac Plus and eventually newer Macs I was consumed with tinkering with the Finder in ResEdit (replacing the Welcome to Macintosh dialog icon with my face was a favorite of my parents), building crazy apps with HyperCard, and generally being mesmerized by MultiFinder, AppleTalk, and so many other now-defunct Apple ideas that made things “just work” in an era when absolutely everything about computers and connectivity was a nightmare. I gained plenty of experience tweaking out Unix, later Linux, and Windows setups with friends, school, and work, but my heart was won by Apple. I became that guy who had to do everything just a little bit better on his Mac. When I finally managed to save up for my first computer that was “all mine” in middle school, it was a Mac (and the Mac price premium in the 90′s was still no joke!), and when I downloaded my first MP3 (New, if you must know) it was loving played on my very own Mac using Audion. I hauled my Mac around to LAN parties and then eventually off to college.

Not far into college, and already working at a company producing mainframe-esque software that had very little in common with Apple, I was lucky enough to get on board the Apple University Program and win a free tip to the Apple WWDC that year. While I couldn’t realize the significance at the time, this was a really pivotal time for Apple: Mac OS X had just gone beta and they were on the verge of iTunes and iPod taking the world by storm. We happily piled into our campus rep’s company van and trekked from Boulder to Cupertino, tinkering with our Apple-provided Blueberry, Lime, and Tangerine iBooks (back when this was a laptop not an eBook!) all the way. Once there we got to hear more about how Mac OS X was going to change the world, see the iTunes visualizer splashed across every projectable wall in site, and bask in the notorious “reality distortion field” from Steve himself. And if the trip wasn’t already enough, I was lucky enough to be the winner of a brand new white iBook from their random drawing! I proudly vowed to use it for all my ongoing Unix and Java development. Steve told us all that if we were serious we should really come back and work at Apple that summer, and while I didn’t take him up on it every hyped Apple product release since (which in retrospect, this one surely paled in comparison to), makes me smile and think of this trip right as Apple was on the verge of becoming the king of consumer computing.

Now, Apple products provide not just some elitist way I can do everything with my computer better and easier, but a complete transformation of how I live my day. Mac at work, Mac at school, iPod in the car, iPhone, iPad, Apple TV… there’s nothing I couldn’t do per se without any one of these, but replace them with the runner-up across the board and it would be a very mediocre experience indeed. Every day for me and millions of others is more productive, more enjoyable, and more wonderful because of these ideas that became products that became staples of how we relate to technology, and ultimately, each other.

Steve, you were the ultimate inventor who knew what the world wanted before we did and a model for accepting only the best for all of us who build hardware, software, and user experiences for a living. Thank you for making our world so much better and the brilliant legacy of Apple (and Pixar!) to continue to amaze us for many years to come.



The iPad and Google+

Great succinct insight on Google versus Apple on The iPad and Google+. This is exactly what has been bugging me about Google lately. Everything they are doing is either an acquisition (YouTube, Picasa, countless others), reactionary (not just Google+ but everything from Gmail to Android), or in varying states of half-ass or abandonment (Wave, even GWT). I use a lot of these products, but they don’t make me love and admire them like my iPad, or for that matter my BMW. What is Google setting the pace on and sticking with that isn’t search and… um… lots and lots of advertising? Building an even better me-too for everything is only going to go so far. Someone needs to (re-)read Good to Great (which I’ll amend for Google to be Great to Not Irrelevant). I foresee a serious identify crisis if they don’t redefine that thing. Thank you Kyle for giving us the straight scoop here!


No Comments

From Dropbox to Google Docs, the cloud rocks

My wife and I finally made the much-anticipated conversion to a couple new Sandy Bridge iMacs as our sole home desktop computers, replacing a whole hodgepodge of custom-built super-towers over the past 10+ years. One thing that really jumped out at me this time was how little I had to migrate. Cloud storage has come a long way in the last couple years, and between Google Docs and Dropbox I didn’t have a whole lot to worry about. We basically just had our giant music, photo, and video libraries (in this case iTunes, iPhoto, and iMovie) to copy, but the rest was ready to go.

It also made me realize that the barriers to fully adopting cloud storage for either of those big three are not just the obvious ones – storage capacity and bandwidth – but really desktop integration. For example, I love Dropbox because it integrates so seamless on my desktop, laptop, iPhone, and iPad; it behaves just like a really smart shared folder. This is why the initial release of Google Music misses the mark for me, and I’m hoping Apple does better with the upcoming iTunes cloud. Once we get some great integration along with heaps of capacity I’m hopeful that our next big migration might be completely free of file copying!

, ,

No Comments