Clients @ 12 December 2011, “No Comments”

A colourful, touch-reactive toy. Just touch the screen and watch the big, bright particles light up the screen and react to yours swipes. Multiple touches introduce a centre-of-gravity that causes your particles to swirl around.

This was a personal project where I brought together some knowledge of OpenGL, from my days at digital agencies in London, on to modern devices such as the iPhone 4S and the iPad 2. This app is very graphically intensive and involves plotting a large number of particles using a meta-ball technique. The main aim of this app was to show that a seemingly complex app could be designed, built and deployed in under 2 months by constraining scope and focusing on user experience.

The app has just been released and is available on the iTunes App Store.

Screenshot 1

Screenshot 2

Screenshot 3

Screenshot 4

Screenshot 5

I’ve recently started using Git to deploy to my servers. Anyone who has used Heroku would be familiar with this technique and it feels kinda cool to be able to think of your different environments as just git remotes. I can’t vouch for the appropriateness of this technique in the general case, but I just wanted to make a note on what I’ve found to work for me. Hopefully, others may find this useful.

So, I use GitHub as my main source code repository, but I set up a second repository on the server I want to deploy to, normally in my home directory. First create an empty Git repo:

$ git init --bar ~/git/my-repo.git

To trigger a deployment on a push, we define a post-receive hook in this new repository. Hooks allow the you took invoke behaviour on a variety of git events, in this case we are interested in when the repository has successfully received a push.

$ vi ~/git/my-repo.git/hooks/post-receive

This is just an example, but the contents of the post-receive hook might look like this for a rack/passenger based web application:

#!/bin/bash

cd /var/ww/my-site
unset GIT_DIR
GIT_WORK_TREE=/var/ww/my-site git pull
GIT_WORK_TREE=/var/ww/my-site git reset --hard
GIT_WORK_TREE=/var/ww/my-site git submodule update -i
bundle install
touch tmp/restart.txt

Of course, this file can contain whatever you want, just make sure you set the executable bit on the file:

$ chmod +x ~/git/my-repo.git/hooks/post-receive

All that remains is to push your local repository to the new git repo on your server:

$ git remote add prod ray@my-server.com:~/git/my-repo.git
$ git push prod master

This is just a simple example, but because you are executing a script on the server, you can basically perform any functionality you like. I don’t know whether this would be a good idea in a large-scale production environment, but the key here is to make the deployments as simple and easy as possible to encourage smaller and more regular changes. Backing it with git enables a basic form of rollback, but anything that is not controlled by git, i.e. database schema state, will still need to be managed separately.

Clients @ 12 October 2011, “No Comments”

PlayUp is a Melbourne-based startup who are bringing sports and social networking together. I, along with some of the top names in development in Melbourne, were brought together to work on the iPhone app. The app has just been released and is available on the iTunes App Store.

Home screen

Add friends

View a match

Chat with friends

View live matches

Previously I had created an Xcode plugin for Hudson to allow you to configure and invoke builds directly. Although this worked for some cases, there are a few projects where the build process is more complex or non-standard enough to force me back to scripting things manually. Rather than update the plugin to try and cope with every esoteric use case, I decided to flip things around and simple create a ruby-wrapper for Xcode. This allows me to take what i need and create custom Rakefiles to control the build process. The aim of this gem is provide an object model for navigating the project structure and be able to invoke some common types of modifications. I aim to gradually add more functionality to this gem as I come across new use cases.

The source is available on github, but it is available to install from ruby forge by using the command:

$ gem install xcoder

A simple use-case would be to find the only project in a directory, update the project’s build number and then invoke a build:

# Find the first project in the current directory
project = Xcode.find_projects.first

# Find the target called "TargetName"
target = project.target(:TargetName)

# Find the configuration called "Debug"
config = config.config(:Debug)

# Update the build number
config.info_plist do |info|
    info.version = ENV['BUILD_NUMBER']
    info.save
end

# Clean the build for this target's configuration 
config.clean

# Build the target using this configuration
config.build

# Create an IPA for this target's configuration signed using the provided identity and embed the provided profile
config.package :sign => 'iPhone Distribution: Developer Name, :profile => 'Provisioning/ProfileToEmbed.mobileprovision'

It’s early days yet, but I plan on adding support for OCUnit => JUnit output mapping (like the xcode-hudson-plugin) as well as loading provisioning profiles from the file system and generally manipulating the project file. Please send issues/feature requests to the Xcoder page on github

Clients @ 12 September 2011, “No Comments”

Mobile Awards 2011
We won the “Best New Service or Application” category in the Mobile Awards 2011! Congratulations to everyone involved and I am sure we will all go on to make more award winning apps!
Mobile Awards 2011

Blocks in Objective-C have been a life-saver and allowed our code to become terser and more understandable. Although some of the main parts of the iOS SDK have block-based alternatives (animations, etc), KVO is still based on defining a method with a well-known signature in your observer (not even defined by a @protocol and doesn’t allow the use of arbitrary @selector). I felt there should be a way to be able to achieve this and the result is this project on github.

In order to encapsulate the observation, a new instance of an object that implements the callback method signature is created for each observation and passed back to the caller. It is expected that this object is retained by the caller until the caller wants the observation to end. I’m not totally convinced that this is the best pattern, but it is at least concise and uses the existing language semantics. So, on to a simple example:

As you can see, this is very terse and means that all the code to react to changing properties can be encapsulated in the one place. The returned value is being set to a retained property so that the binding does not get dealloc’d. This observation will remain in effect until you release the returned object by setting the property to nil (as in the example) or, indeed, set the property to any other binding.

I would be very interested in feedback about whether this works for you.

This is a simple plugin for Hudson CI that wraps and provides limited functionality for agvtool and xcodebuild to version and build XCode-based iOS projects.

The plugin is mature enough to support building, versioning, IPA packaging and basic testing view OCUnit.

Download

You can download a pre-built binary of the latest snapshot build (0.1-SNAPSHOT) using the latest code from github. Look below for source code and build instructions.

Issue Tracking

Please report any issues and feature requests via GitHub’s issue tracker.

Features

Versioning

This builder can invoke agvtoool to dynamically update the CFBundleVersion with the current build number using a configurable pattern. For example, you could specify a pattern of “1.1.{BUILD_NUMBER}” which, for build #456, would result in the current version (CFBundleVersion) being set to 1.1.456

Building

The target (optional), configuration (e.g. Debug, Release) and SDK (optional) can be specified in the per-project config along with whether to perform a clean before the build phase.

Packaging

The builder can be used to package the .app into a .ipa. Since a .app is actually a directory, it can be awkward to work with and, especially, distribute. We can simplify this by packaging the .app into a single .ipa file, which is just a zip file with a well-known internal structure

Unit Testing

This plugin will listen to the xcodebuild output when running OCUnit tests and write out JUnit-format test reports that Hudson can understand. Hudson will then use these to publish test failure reports and graphs.

Gotchas & Limitations

  • Obviously, the build machine has to be an OSX machine with XCode developer tools installed
  • Certificates, Identities and Provisions must be installed on the build machine separately
  • When code-signing, a prompt may appear on the build machine asking whether to allow keychain access. This will block the build until it is dismissed. Just select ‘Always Allow’ the first time and it shouldn’t need to ask again.
  • If you connect via ssh to the OSX slave, you will need to execute ‘security unlock-keychain’ once you connect to allow the build tools access to the keychain. The alternative is to use the JNLP slave agent
  • Derek Stutsman reports that “If your project has the base SDK set to iPhone simulator, the build will crash with a nullreference exception”

Building

The source code is hosted on GitHub and made available under the GPLv2 license.

This is a maven project that uses the hudson maven plugin. You will first need to add the following to your ~/.m2/settings.xml:

 
 

org.jvnet.hudson.tools 
   
 

To clone the repository and build the .hpi, follow these steps:

 
# Clone the repository
$ git clone git://github.com/rayh/xcode-hudson-plugin.git

# Go into the cloned repository
$ cd xcode-hudson-plugin

# Build the project
$ mvn install

The xcode.hpi will be in the target/ directory.

Installing

I am awaiting commit access to the hudson repository on java.net so that I can use the official hudson to build the plugin as well as hosting the plugin in the official repository. Until then, you will have to install it by manually uploading the xcode.hpi to hudson. Simply go to ‘Manage Hudson’ > ‘Manage Plugins’ > ‘Advanced’ > ‘Upload Plugin’ and select the xcode.hpi that you either built or downloaded and then select ‘Upload’.

Usage

Setting up a build step

Add the XCode build step to a free-style project and set the target (e.g. MyApp), configuration (e.g. Release) and check the build IPA and update version number options. This will give you a single, versioned .ipa file. You can also select to clean the project before a build; while this will make sure that the project is starting from a clean state, it will make large projects take a lot longer.

Setting up a unit test step

Add the XCode build step and this time specify your unit test target (e.g. MyAppTests), configuration (e.g. Debug) and the SDK (e.g. Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/). Leave all the checkboxes unselected. The SDK needs to be supplied here as the unit tests will only be run when building under the simulator’s SDK.

Check the “Publish JUnit test result report” option in the project config and set the value “**/test-reports/**.xml” under “Test report XMLs”. This will tell Hudson to pick up the JUnit-format test reports.

Acknowledgements

The xcodebuild/OCUnit output parsing was inspired and based upon Christian Hedin’s ocunit2junit.rb script.

Jarrod McIntyre provided support for overriding the marketing version number

Clients @ 01 May 2011, “No Comments”

I worked at Sensis as the development lead on the Yellow Pages iPad application. This native app brought print content to a digital device for the first time. Download it from the iTunes App Store.

Yellow Pages iPad Home View

Search Results in List View

Search Results in Book View

Business Profile View

Clients @ 02 March 2011, “No Comments”

I designed and built the programme information service for PBS 106.7FM that manages the schedule information for the station and whose job it is, essentially, to know what is on when with as great a detail as is possible. The app is a RESTful web service written in Ruby/Sinatra and the UI is pure HTML/jQuery/CSS and uses the same API..

I have also built a iPhone radio app that integrates the same service and gives users access to the live AAC+ stream as well as the programme guide. It is available from on the iTunes App Store

[From their website] For 25 years, PBS-FM has been a beacon of independent, freeform, passionate, real and unpretentious radio. PBS is a champion of specialist and under-represented music and is proudly non-corporate, anti-fashion and wanker-free.

www.pbsfm.org.au

Development @ 22 February 2011, “No Comments”

My AppStore apps are currently all reporting that “This item is no longer available in the App Store” or “This item is temporarily unavailable” as of couple of days ago. I have received no notification from Apple and apparently nothing wrong in iTunes connect. After a bit of googling I stumbled across this blog post where it seemed that at least one other person had experienced something similar.

I followed the post’s suggestions and updated my availability date and suddenly the app was marked as “Pending Contract”. However, all my apps are currently freebies and so there are no contracts in place, nor should there be. I filled out as much of them as I could (bar registering for GST), but to no avail.

I seem to be at the whim of Apple’s famously distant customer service right now.

Update: I eventually solved this by releasing a new version of the app, the process seemed to fix the existing app as it immediately reappeared in the app store while the new version was awaiting approval. Go figure!