Howto: Setup your Unify Project development environment

Deutsche Telekom recently released their metaframework Unify, for mobile development built on HTML5, JavaScript and Sass.

Unify Project aims to provide a unified API for building cross-platform mobile and desktop applications.
It wraps a couple of frameworks like PhoneGap, qooxdoo, Sass and Adobe Air.

I started playing with it and it took me some time to figure out how to install all the tools needed to start an iPhone application with XCode. In this blogpost I’ll describe how to setup your development environment on your Mac to start developing iPhone applications with Unify.

Download all the tools

Lets say we have a folder named ‘Projects’ in our user folder on the Mac.

1
2
$ mkdir -p ~/Projects/Unify
$ cd ~/Projects/Unify

Download qooxdoo (from http://github.com/unify/qooxdoo)

1
$ git clone http://github.com/unify/qooxdoo.git

Download Unify (from http://github.com/unify/unify)

1
$ git clone http://github.com/unify/unify.git

Download Phonegap-iphone (from http://github.com/phonegap/phonegap-iphone)

1
$ git clone http://github.com/phonegap/phonegap-iphone.git

Now we install Phonegap

1
2
3
4
5
$ cd phonegap-iphone
$ git submodule init
$ git submodule update
$ make
$ open PhoneGapLibInstaller.pkg

This will install the PhoneGap Library and the PhoneGap XCode Template

Install the Unify XCode template

Create link to Unify XCode template

1
2
3
4
$ cd ~/Projects/Unify/unify/support/xcode
$ mkdir -p ~/Library/Application\ Support/Developer/Shared/Xcode/Project\ Templates
$ rm -f ~/Library/Application\ Support/Developer/Shared/Xcode/Project\ Templates/Unify
$ ln -s ~/Projects/Unify/unify/support/xcode/templates ~/Library/Application\ Support/Developer/Shared/Xcode/Project\ Templates/Unify

Configure XCode preferences

1
2
3
$ cd ~/Projects/Unify/
$ defaults write ~/Library/Preferences/com.apple.Xcode PBXApplicationwideBuildSettings -dict-add WORKSPACE ~/Projects/Unify/
$ defaults write ~/Library/Preferences/com.apple.Xcode PBXSourceTreeDisplayNames -dict-add WORKSPACE "Unify Workspace"

Creating an Unify application

1
$ unify/tools/create-application.py -n <appname>

This will create a new folder named <appname> and copy the basic unify app template in it.

1
$ cd <appname>

Prepare development version (re-run after major changes)

1
2
$ ./generate.py source-mobile
$ ./generate.py source-phonegap

Create development version

1
2
$ ./generate.py build-mobile
$ ./generate.py build-phonegap

Now when we start XCode and create a new project, we choose Unify as project template.
Name the project ‘iphone’ and tell XCode to create it in <appname>/build/mobile/
You can change the application name in the info.plist file afterwards.

Tags: , , , , ,

Laat een reactie achter