Chinaunix首页 | 论坛 | 博客
  • 博客访问: 384503
  • 博文数量: 158
  • 博客积分: 1227
  • 博客等级: 少尉
  • 技术积分: 946
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-20 16:19
文章分类
文章存档

2016年(1)

2015年(1)

2012年(107)

2011年(49)

分类:

2011-05-31 10:40:10

Setup QEMU-based MeeGo Emulator

  1. Enable Graphics Acceleration
  2. Virtualization (VT) support is needed on your system for graphics acceleration. Check the to ensure your system is capable. If your system is not enabled, see the .

  3. Download the MeeGo SDK Image for your target, as described on the page.
  4. Download and install QEMU-GL virtual machine on your host development system
  5. Host OS QEMU GL Package How to install
    Fedora 12 or 13
    $ sudo yum localinstall qemu-gl-0.12.4-5.1.i386-fc12.rpm --nogpgcheck
    
    Ubuntu 9.10 or 10.04 (see below for 64bit)
    $ sudo dpkg -i qemu-gl_0.12.4-4_i386.deb
    

    Building From Source: For information on building qemu-gl from source, see the .


  6. Download launch script:
  7. Launch QEMU-GL with the MeeGo image
  8. $ tar xvjf 
    $ chmod +x ./meego-qemu-start
     To start handset image with Avaa device skin:
    $ ./meego-qemu-start -s aava 
     To start netbook image without skin:
    $ ./meego-qemu-start 
    

    (See the script for details on the command and parameters)

    MeeGo Handset UI in QEMU
    MeeGo Netbook UI in QEMU

Installing qemugl on 64 bit ubuntu 10.04

The ubuntu package above is for 32bit systems and won't install on 64bit systems. Several additional steps have to be taken to install and run it on a 64bit device:

  1. Force installation package on 64 bit system
  2. $ sudo dpkg -i --force-architecture qemu-gl_0.12.4-4_i386.deb 
    
  3. Check for missing 32 bit library dependencies
  4. $ ldd /usr/bin/qemugl
    
  5. Download missing libraries from 32 bit repository (search )
  6. $ wget http://launchpadlibrarian.net/30426073/libcurl3-gnutls_7.18.0-1ubuntu2.2_i386.deb
    $ wget 
    
  7. Extract libraries into local directory
  8. $ mkdir tmp
    $ dpkg -X libcurl3-gnutls_7.18.0-1ubuntu2.2_i386.deb ./tmp
    $ dpkg -X libgnutls13_1.6.3-1build1_i386.deb ./tmp
    
  9. Copy 32 bit libraries into /lib32
  10. $ sudo cp ./tmp/usr/lib/* /lib32 
    
  11. Run qemugl
  12. $ qemugl 
    

Using QEMU for Application Development

Install Qt Creator and MADDE

  1. System Requirements
    • Host system should have 8.3GB free disk space
    • "rpm" build support: Download and install the required package on your host development system
    • Host OS Required Package How to install
      Fedora 12 or 13 rpm-build
      $ sudo yum install rpm-build
      
      Ubuntu 9.10 or 10.04 rpm
      $ sudo apt-get install rpm
      


  2. Download installer for Qt Creator with MADDE (MeeGo Application Development & Debug Environment)
  3. File Size MD5SUM
    install-meego-dev-env-0.7.25-linux-i686.sh 225MB 60f22163789d299bec0e479d46fe2a51

    Add executive permission, run the binary, and follow the instructions to install MeeGo Qt Creator

    $ chmod +x install-meego-dev-env-0.7.25-linux-i686.sh
    $ ./install-meego-dev-env-0.7.25-linux-i686.sh
    

    All tools are installed in $HOME/meego-sdk by default. For convenience, we export the installed path for the next steps:

    $ export MEEGO_SDK=$HOME/meego-sdk/0.7.25
    
  4. Create MeeGo development target (toolchain) from image file
  5. Before we can use Qt Creator to build applications targeting MeeGo, we need to create one or more targets:

    $ cd $MEEGO_SDK/bin
    $ ./mad-admin create_from_image 
    

    where is the full path to the netbook or handset image file (.raw.tar.bz2) that you downloaded above. This will create a target whose name is the same as the image file name, without the ".raw.tar.bz2" suffix. Multiple targets can be created by supplying different image files to this command line.

  6. View or Remove targets and runtimes
  7. To view the list of targets and runtimes:

    $ ./mad-admin list
    

    You can easily remove the target image you created in the previous step:

    $ ./mad-admin remove 
    
  8. Start Qt Creator
  9. Start Qt Creator for your development:

    $ ${MEEGO_SDK}/tools/qt-creator/bin/qtcreator
    

Use Qt Creator to Develop MeeGo Applications

  1. Configure Qt Creator to use the MeeGo toolchain
  2. Go to the menu: Tools -> Options -> Qt4 -> Qt Versions.
    Click the "+" button, and then fill the "Version name" and the "qmake location" of MeeGo target: ${MEEGO_SDK}/targets//bin/qmake (Please replace ${MEEGO_SDK} by your own SDK installed path)

  3. Create a MeeGo touch project (for handset) or Qt Gui project (for netbook)
  4. Go to the menu: File -> New File or Project -> Qt Application Project -> Meego Touch Framework Application.
    File:Meego sdk new.png

    At the end of project creation, you will see the "Project setup" dialog. Choose the MeeGo toolchain you configured.

    File:Meego sdk project setup.png

  5. Build configuration of MeeGo project
  6. Click the "Projects" icon on the left of Qt Creator. The "MeeGo" build and run configuration page will be shown. Create a new build configuration by selecting the "Add" dropdown button and selecting the MeeGo toolchain you configured above.

  7. Create an emulator runtime for MeeGo
  8. Get to the menu: Tools -> Options -> Projects -> MeeGo Device Configurations. Click "Add" button to add a runtime for emulator. Set "Device type" to "MeeGo emulator"; set "Authentication type" to "Password"; "MeeGo emulator" as "Device type", set "Username" to "root"; set "Password" to "meego".

  9. Set Run Configuration
  10. Click "Projects" again on the left side. Select "Run" in the MeeGo Build/Run box at the top. Make sure that the "Device configuration" is set to "MeeGo Emulator". This will ensure that QEMU is started when you run your application. You can now launch the QEMU MeeGo emulator. Click the "Start Meego emulator" icon near the bottom left corner of Qt Creator (circled in red in the screenshot below).

  11. Build, run and deploy the application
  12. After QEMU starts, click the "Run" icon to run your application. Qt Creator will package and deploy your application to QEMU and start it on the target. You can see the window of your application in QEMU.
    Image rotation: If you are using the MeeGo handset image, you can rotate the screen with ALT+SHIFT+R

  13. Debug the application
  14. You can also debug the application by clicking the "Debug" icon. Setting breakpoints and stepping are the same as local applications.

Configure Qt Creator to work with real devices

Qt Creator working with QEMU is out of the box, but sometimes we need to work with real device. Here is how:

  1. Go to Tools -> Options -> Projects -> MeeGo Device Configurations and click "Add" button. Select "Remote Device" for "Device type", input other information and give a name for this configuration
  2. Open your project and in the "Projects" mode, click "Run" in the little MeeGo target window, and select the configuration you just created in "Device Configuration"
  3. Click "Run" or "Debug" on the lower left corner of Qt Creator to run or debug your application on the configured Device.

SSH into QEMU Image

Anytime MeeGo is running in QEMU, you can use SSH to connect to the image from another terminal on the host system.

  1. Launch QEMU with MeeGo image (step #5 above)
  2. From a terminal on the host, connect to the running image
  3. $ ssh meego@127.0.0.1 -p 6666
    

Two user accounts are available in the MeeGo images:
User: meego Password: meego
User: root      Password: meego

Explain projects generated by MeeGo Touch Framework project wizard

  1. .pro
  2. It is the Qt project file for qmake to generate Makefile. Please pay attention to the following lines:

    CONFIG += meegotouch # This is to tell qmake to add necessary include and library path for MeeGo Touch Framework
    target.path=/usr/bin
    INSTALLS=target # These two lines are to generate "install" target, so that we can generate RPM package and deploy it to QEMU-GL or device to run.

  3. main.cpp
  4. It is a typical MTF application main program including initialization of MApplication, MApplicationWindow and MApplicationPage

MeeGo Touch Framework Help and Documentation

We have integrated MTF help document into Qt Creator. Just click on the "Help" mode, you can see "MeeGo Touch Reference Documentation". You can also press "F1" in source code to start context helper. More up to date Qt and MTF documentation can be found at http://meego.com/developers/meego-api

阅读(1523) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~