Appcelerator Titanium on Ubuntu 9.10 (i686): So Easy (VIDEO)

by Bill Dawson on 1 April 2010

I was pleased to discover just how easy it is to get Titanium up and running on Ubuntu 9.10.  Now I’ve got it running on Windows, OSX and Ubuntu.  Why?  Because I can! 🙂

No but seriously: my desktop at work is Windows, at home it’s OSX, and my notebook is running Ubuntu 9.10, the Karmic Koala.  I really like my notebook, a Dell XPS m1330.  It’s a very competent and nice looking device and it runs Ubuntu just great.  So I’ve no excuse to run out and buy the more expensive Apple Macbook.

(You can see the “Appcelerator Titanium on Ubuntu 9.10” video at Vimeo, or right here in this player within this blog entry.)

Now, it’s true that with Titanium on Ubuntu the only mobile dev you can do is for Android, since iPhone dev can only be done under OSX.  But one of the great things about Titanium is using the same code base for both Android and iPhone development, which is very possible as long as you don’t use any features that are iPhone specific (the Android part of the Titanium Mobile SDK is almost caught up with iPhone but not quite yet).

Right, so how easy was it to get Titanium Developer 1.1 up and running on Ubuntu?  Very easy.  There are just two pre-reqs:

  • Sun JDK 1.6
  • Android SDK for the 1.6 Platform

Those “1.6s” are purely coincidental, by the way.  And for the SDK, Google has changed their emphasis to “API Level” as opposed to ” platform version”: the SDK for Android 1.6 is API level 4 (who knew?)  The latest platform (2.1) SDK has API level 7 (but of course it does!).

Anyway, getting the Sun JDK is this easy:

sudo apt-get sun-java6-jdk

For the Android stuff:

  • visit the Android SDK page and download the Linux version.
  • Untar it directly in the parent folder to where you want it to live (I kept mine in my own home folder structure by untarring it to a folder I created: /home/bill/opt.)
  • That will create a folder named android-sdk-linux_86/.  Go to that folder’s tools/ subfolder and run ./android.
  • That will open up little SDK management app called the Android SDK and AVD Manager.  First thing to do in that is click on Settings (in the left nav area) and select the option to force “https” links to use “http” (I’ve no idea why this is necessary.)
  • Next, click on “Available Packages”, open the tree there and select the API 4 items.  You can also select items belong to API versions above 4, but you absolutely need the API 4 options (“SDK Platform Android 1.6” and “Google APIs by Google Inc, Android API 4”).
  • After those are selected, click “Install Selected”.
  • At the license screen, select the option to accept all of the licenses, then click “Install”.

That’ll download those SDK platforms and APIs — takes a little while.

After that’s finished, you’ve got the Android SDK successfully installed to the extent that you need it for Titanium.  I then recommend that you add the SDK’s tools path to your path.  So, for example, I edited my ~/.bashrc thusly: PATH=$PATH:/home/bill/opt/android-sdk-linux_86/tools export PATH

The next step is to download Titanium itself from Appcelerator.com.  Of course you want to download one of the linux packages — I chose the 32-bit .tgz file.

Extract that .tgz file somewhere.  I extracted it directly in ~/opt, which is where I want it to live.

Then go into the extracted folder and run the Titanium Developer executable.  You’ll go through some setup steps, including either creating an Appcelerator account or logging in to your existing one.

It will then most likely prompt you to download a newer version of the mobile SDK, which I did.

Next, tell it where to find the Android SDK by going to the “Edit Profile” screen (you click the solo person on the upper-left nav buttons).  You’ll see a field there for the location of your Android SDK — type the path there.  For example, I typed /home/bill/opt/android-sdk-linux_86.

Save those settings and then you’re ready to roll.  You can now create and run mobile projects.

I go into greater detail in the video, including what to do if the Android emulator gets flaky.

Enjoy using Titanium on Ubuntu!

[UPDATE: Near the end of the video, at about 14:00, I get an error message from the Android emulator.  I say in the video that this type of error looks serious to me, so I restart the emulator as well as Titanium Developer.  Don Thorp of Appcelerator has since told me that I could have simply clicked “Wait”, which was one of the options that I received when the error was shown.  So that’s good to know, since stopping and starting the emulator takes so long!  So it was not necessary for me to start and stop the emulator at that point.]

[UPDATE: My video shows me installing to 32-bit Ubuntu.  You 64-bit users will want install the 32-bit compatibility libraries:

apt-get install ia32-libs

That tip courtesy of Chris Barber, who left a comment below. Thanks Chris!]

Frederick August 24, 2010 at 6:01 am

Nice Tutorial… Thanks… I just have difficulty installing this Titanium just now. But now it all work for me.. Thanks

Bill Dawson May 28, 2010 at 12:37 pm

Hi Thomas,

Be sure to post your issue over at the Q&A site. Enter “ubuntu” and “android” as tags. Then hopefully someone who has experience with 10.04 can help you. May want to also check out this Google search.

Good luck!
Bill

thomas May 28, 2010 at 9:58 am

Hi Bill Dawson,

Thanks for your nice video tutorial. I was also having the same problem as xcr2 has. But i am using Ubuntu 10.04 ! Emulator is not launching !!

bunyawat April 18, 2010 at 1:21 pm

Thank you for the link.
It help.

bunyawat April 18, 2010 at 1:06 pm

Same as my. I am using Ubuntu 9.10 64bit. and download Titanium Developer Linux 64 bit. I can use eclipse plug in for android to run emulator with out any issue

xcr2 April 13, 2010 at 5:44 pm

wow thanks!

Bill Dawson April 12, 2010 at 10:27 am

Hi,

Thanks for stopping by and taking the time to comment. Sorry your comment took so long to appear here — it happens only the first time you comment.

For your problem, see: http://developer.appcelerator.com/question/12931/getting-the-error#29301

Regards,
Bill

xcr2 April 10, 2010 at 7:30 pm

Thanks for the video!

I created a new mobile project (android) an clicked on Test & Package, then Run Emulator, but I have no emulator.

See screen:
http://img541.imageshack.us/img541/450/bildschirmfototitaniumd.png

Do you have an idea why an how to get the emulator running?

Thanks!

Bill Dawson April 1, 2010 at 10:12 pm

Thanks for adding that, Chris. It’s important enough that I’ll actually append it to the article.

Chris Barber April 1, 2010 at 10:11 pm

Great article! For those out there there running 64-bit Ubuntu, you’ll want to install the 32-bit compatibility libraries so Android is happy.

apt-get install ia32-libs

Bill Dawson April 1, 2010 at 9:16 pm

Thanks Jeff!

Jeff Haynie April 1, 2010 at 5:21 pm

Great write up!

Comments on this entry are closed.

{ 1 trackback }

Previous post:

Next post: