Thursday, November 24, 2011

Rhodes Iphone Build using Xcode

In this post we will create Rhodes build from Xcode. Though we can do this by rake run:iphone for development and rake run:iphone:production for Production but for better understanding and advance configuration we can do the same with Xcode. 

To start quickly,  these are the prerequisite:
  •        Valid Provision Profile should be installed.
  •        Valid Certification should be installed.

For getting these Certification login to Apple Development Center and navigate to iOS Provisioning Portal.

Now to get started follow these steps:
  •    Go to your project folder from Terminal and type:          

             $rake switch_app

The switch_app command changes the rhobuild.yml in the Rhodes source code folder to point to your application, as in the following example for a Rhodes application named Store in the user’s home folder:

    app: /Users/Name_Of_User/Application_name
  • Now run the following command to tell Rhodes to set up the Xcode environment for your Rhodes application:

          $ rake build:iphone:setup_xcode_project

  •    Open rrhorunner.xcodeproj project. This will open your application in Xcode. You can find this project in Gems folder of ruby -> Rhodes-> Platform-> iphone. After opening the project we can see rhorunner project is open in Xcode.

  • To run the application select rhorunner project and then select where you want to run the application. If you have connect iOS device it will appear on list for example in given image I have connected my iphone "Abhishek Nalwaya's iPhone"

If we select "Abhishek Nalwaya's iPhone" and click on Run then it will automatically create the build and install the application on the device. To run in the simulator you can select from the list. 

Debugging Notes: 
  • Make sure you have register the device to appstore for testing.
  • Make sure you have selected correct Code Signing 

  • If you want to restore the XCode use following command:

              $rake build:iphone:restore_xcode_project

If you face any issue feel free to comment on this post.