Screen Shot 2012-08-22 at 7.27.04 PM

So we played about with ruby motion and the simulator, this is great but now we want to show some one what we’ve done or testing on a device (This is very important as I’ve had some issues between device and simulator).

I assume that you’ve been playing with ruby motion and using the the standard rake command to run up the simulator. The rake is command (rake -T to see all) ‘rake device’ but before you try to deploy to a local device you will need to have a Mobile Provisioning Profile. What is that? Well that is the process that apple use to sign code for deploy and releasing code. So now that we’ve been using ruby motion it is now time to pay apple for an iOS developer account subscription; this costs $99 per year for individual or company,

NOTE: Individual takes a day or so to get done where as the Company is dependent on where you are.

A Company requires a DUNS number (Dun and Bradford credit agency Number), this is free. Each region approach to getting a DUNS dependents on the regional office; in Australia we needed to fax… yes I said FAX a form to the sydney office with the Companies Details. Also note that the company requires a landline to be added to the DUNS profile as you must enter a landline in the apple profile and it must match.

It can take up to 30 days for the synchronisation of the DUNS regional database to the DUNS worldwide database and then to the Apple database I was informed by the local DUNS rep.

Please note that the information in the ‘Personal Information’ of the person applying for a company needs to match that which is on record in the DUNS system. This is the name, address etc, exactly; I had an issue that took weeks to discover that the person entering the data from the fax had entered ‘Rd’ rather than ‘Road’ which was on the fax. The DUNS local staff were very helpful, and the lady took a screen shot of the data in the system which helped me get this resolved. The Apple Staff via email were not helpful, I received the same canned response that my details did not match and to update my DUNS profile and try again in 14 days. After much annoyance I finally got the number and called them up to unlock my account again, if you try too many times it locks your account and mine got locked a lot as my information matched that on the fax. This is not intended as a rant but a warning to ensure that you allow yourself enough time to go through this process.

You can check what apple have in their copy of the DUNS database with this url

If your an individual it is easy to get the access, just takes a day.

Then you can complete the Enrolment Wizard and depending if your an individual or company it is either  a day later or probably 2 weeks later.

Now that we have an apple developer account we can now create the profiles required for deploying to a device. Firstly as I’m not using Xcode we need to use the Keychain Access app to generate the certificate request. The process is described here,

The main points are we generally have three profiles / certificates and they are Development, Testing and Release (App Store). The Development has its own tab, then Test and Release are under the Distribution tab. The difference between Testing is ‘AdHoc’ distribution for services like Test Flight that I discuss in more detail in another post and then App Store for final release.


This the process to get a development device deployment:

Now that we have an account we can now provision the profiles required to deploy your ruby motion to a device.

You can do this with Xcode but I’m not using xcode, therefore I use the manual approach using keychain access. We will request a certificate that is required to create a provisioning profile.

This normal information for developer certificate, you create a certificate for a developer. This will then save the certificate request to a location you specify, this is then used to get a certificate from apple.

The development tab should have a request certificate button (you can revoke existing ones and then the button comes back)

This page is where we upload the certificate request generated from Keychain Access.

This certificate should be downloaded and open it, this should load it into the keychain access.

This shows that the certificate is loaded into the keychain access.

The devices that we intend on using need to be specifically defined in the iOS portal. There are two main ways to get the unique identifier for the device (UUID), iTunes or an App. This page will show you how to get the UUID from iTunes (it is also on the developer portal but you need a developer account to see it, d’oh). Note we only need one developer account for up to 100 devices per year; we can add up to 100 devices but you can only have 100 in total for the year (removing device apparently still counts for the rest if that yearly subscription).

I actually prefer the free app UUID sender, this app will email the devices UUID without need to connect to iTunes. This is very useful for the less techie testers that you may have.

The App ID is very simple, you need to have all devices UUID entered in here if you want to deploy onto them before the App hits the store.

We need to create an App Id for the applications that we are building. This is pretty self evident, you will need a separate App Id for application you will be releasing to the App Store but you can use the same developer mobile provision profile to deploy apps to your local device.

This will create an App ID, that will default the access rights; this is probably fine for now. We need to configure the App Id up to Enable the rights that App needs.

Now we have all the data entered that is required to create the Development Mobile Provision Profile, that will enable us to deploy to our physical device.

This will page is used to create a profile for a given application, the same certificate can be used for multiple profiles etc.

The status will be ‘pending’ and when you refresh the web page you should see the status change to ‘Active’ and then we can download the profile and store it locally (You need to remember the location for the next part).

Now we can return to our Rakefile, we have two properties to add (name of certificate in keychain access, location and name of the provision profile for this application)

This will enable us to run ‘rake device’ you should get a prompt to allow access to the keychain (I’d always allow but up to you). This does assume you have your device (UUID in the profile) is connected to your computer via usb.

There you go, a deployed application to a device. Now you can show some one what you’ve done.

I will run through adding some more devices, debugging, and user testing (via Test Flight) on other peoples devices before releasing the app store in later posts. Subscribe to our RSS feed or check back later.

About drogan

  • Justin McPherson

    Thanks for the info about DUNS, what an unnecessary pain!

    Also cool to see other Aussies using RubyMotion :)