Skip to content

Symbian development using Linux on real life…

I believe most companies that develop Symbian products uses windows, and only windows, on their development process. Well… We don’t =)

When we started to develop symbian applications at INdT we, as open source developers, decided to find a way to keep using linux as our development environment.
On the beginning we didn’t have yet an official way to compile our applications on linux, so we used (and still use) Lizardo’s patchs that enables gnupoc to compile Qt-symbian applications on Linux.

First tip:

Personally I think finding errors on gnupoc output is an exhaustive job. So, the first tip for those who’re using Lizardo’s approach is to use a small piece of code in your .bashrc

function makes60
{
  make debug-gcce 2>&1 | while read line
  do
    echo -e $(echo $line |
      sed 's@\\@\\\\@g' |
      sed "s/.*error.*/\\\e[0;31m(&)\\\e[0;31m/I" |
      sed "s/warning/\\\E[33m(&)\\\E[0;37m/gI" |
      sed "s/No such file/\\\E[33m(&)\\\E[0;37m/gI"
      )
  tput sgr0;
done;
}

By calling makes60, every error/warning message will be highlighted in read/yellow.
It’s a simple tweak, but it is very useful.

So, we can compile our application, easily read the compiler messages… Now what?

Analyzing the process:

Let me list our development phases:

  • Coding: OK with vim
  • Compiling: OK with gcce and some tweaks
  • Debugging: (As we work almost only with default Qt API, we build for linux first and debug there). So, it’s almost OK.
  • Packaging .sis: OK with make sis
  • Send to device, install and test: It’s a slow process yet.

Testing on the device is a very difficult/slow task on linux. We don’t have a debugger. We don’t even have any output message (Ok, we have: with stdioserver writing on an txt file. Too hard!).

How does it works for Windows developers? Carbide++ and TRK!

Of course we don’t want to install Carbide++ on linux. So, can we use TRK with linux? Yes, we can! First of all you need to get the TRK application in Carbide++ package or in newly released Nokia SDK.

Installing TRK:

  1. Send and execute TRK.sis on the device.
  2. Open TRK application / Options / Settings,  and select Connection = USB instead of bluetooth.
  3. Go to TRK mainscreen / Options / Connect.

If your USB cable is plugged you will receive a “Status: Connected” message on your phone.

Now you need to create a serial connection between the device and your linux machine. If you’re using a 2.6.33 kernel you don’t need to do that. Otherwise you need to create it manually.

Before you do that you need some information about the device. It can be retrieved with:

[danilo@docbrown ~]$ lsusb  | grep Nokia
Bus 001 Device 011: ID 0421:0154 Nokia Mobile Phones

So, my vendor ID is 0421, and my product ID is 0154Remember to use your own numbers =)
And then you can load the usbserial mobule with the command:

sudo modprobe usbserial vendor=0x0421 product=0x0154

If everything went OK you should see a message like this:

[danilo@docbrown ~]$ dmesg | grep ttyUSB
[34063.949446] usb 1-4.3.1.4: generic converter now attached to ttyUSB0

Your serial port was created on /dev/ttyYSB0.

Ok, perfect! But how to communicate with TRK?

Trolls are working on that, but for now we’re using the runonphone tool. It’s the same tool used by QtCreator on Windows and you can get it by cloning Qt Repository and compiling the /tools/runonphone folder.

On device testing

After compiled, runonphone can be used by passing the serial port, the sis package and the executable file to it.
runonphone -p /dev/ttyUSB0 -s test_package.sis test_package.exe

As you probably noticed all your qWarning() messages are being redirected to runonphone output. Which is very nice!

On device debugging

We don’t have an interative gdb tool as we have on windows, but Qt guys are close and I’m sure we will have good news in a few days.

Concluding

I’m sure that Symbian development on Linux is near, and it will be massively adopted when those tools became part of QtCreator for linux. For those who can’t wait, or think that VIM is the best IDE ever, I hope those tips can help you. =)

And for those who’re working with Qt for symbian, remember to join the #qt-symbian on Freenode.

3 Comments

  1. Hi Danilo,
    Great post! Just a quick tip, in case you don’t want to download the whole Carbide C++ to get the TRK .sis file, you can find the latest builds on the link below:

    http://tools.ext.nokia.com/trk/

    Best regards,

    Posted on 10-Jun-10 at 1:37 pm | Permalink
  2. Great news! I was really looking forward to that. There are still a quite high number of steps to follow, but it looks like this could be all gathered together in a nice little shell script… isn’t it ?

    Posted on 09-Aug-10 at 3:13 am | Permalink
  3. I’ve been playing with the deployment part from within Qt Creator: http://www.maemopeople.org/index.php/jaffa/2011/03/06/cross_platform_qt_dev_deploying_to_symbi

    Posted on 08-Mar-11 at 8:00 am | Permalink

2 Trackbacks/Pingbacks

  1. […] Possibly related posts: (automatically generated)Related posts on LinuxHow many people think that Linux is a far better operating system …Protected * Void / Symbian development using Linux on real life… […]

  2. […] Symbian development using Linux on real life… I’m sure that Symbian development on Linux is near, and it will be massively adopted when those tools became part of QtCreator for linux. For those who can’t wait, or think that VIM is the best IDE ever, I hope those tips can help you. =) […]

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*