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:
- Send and execute TRK.sis on the device.
- Open TRK application / Options / Settings, and select Connection = USB instead of bluetooth.
- 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 <strong>0421:0154</strong> Nokia Mobile Phones
So, my vendor ID is 0421, and my product ID is 0154. Remember to use your own numbers =)
And then you can load the usbserial mobule with the command:
sudo modprobe usbserial vendor=0x0<strong>421</strong> product=0x<strong>0154</strong>
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.