<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-348  評論-598  文章-0  trackbacks-0

    I’m starting to learn how to develop to Android and so far to me the only downside of the whole dev environment is the painfully slow Android Emulator. Don’t get me wrong, it’s such a beautifully made emulator that covers most (if not all) details of a real device, I specially like tricks such as limiting network bandwidth to simulate your app under a slow connection, but let’s face it, the thing is slow.

    I have to say I don’t have a top of line computer either, it’s a Core 2 Duo with 4gb of RAM running Ubuntu 11.10 (amd64), so I started searching for tricks to speedup the emulator, until I found that Android-x86 can be used as a emulator. The experience is not as good as Google’s official emulator but with some tweaks you can really speedup turnaround both in boot time and overall execution speed. OK, TL;DR, enough small talk, let’s get down to business, click the following link to go to the full post :)

    The Android-x86 project provides some ISO images that can be ran on VirtualBox (download it here if you don’t have it yet). I took the time to wrote the steps bellow based on various blog posts about the subject.

    First, download an ISO from Android-x86 download page, android-x86-2.3-RC1-eeepc.iso should do, this one is pretty stable and has ethernet support. There is a RC1 honeycomb port here but I didn’t test it.

    Now create a VM on VirtualBox, my settings were:

    Linux / Linux 2.6, RAM: 256 MB, Fixed Size, 512 MiB VDI Disk

     

    You can play with these options to find which ones fits better with your apps, for me 256 MiB was sufficient

     

     

    OK, after that you need to setup the ISO file, to do this select your VM from the list and go to Settings / Storage, click on the disk icon and chose a virtual CD/DVD disk file. Select your ISO of choice :)

     

     

    Now go to Network, there you have two easy options – If you have a router on your network, select Bridged Adapter and your internet connected adapter (mine is eth1). This is the easiest option in my opinion.

     

     

    If you don’t have a router or if it didn’t work for any reason, select NAT. Using NAT you can’t connect directly to the device, but thankfully VirtualBox has a handy port forward feature. To use it you just need to click on Advanced / Port forwarding and add a rule like this one:

     

     

    Note that no matter which mode you choose you need to click in advanced and select PCnet-FAST III as the Adapter Type.

    You can also disable the USB controller if you don’t need it.

    Now click OK and start up your VM. From the GRUB menu, select Install to Harddisk

     

     

    Follow screen instructions. From the partition options menu select Create/Modify partitions, this will show you the partition manager (cfdisk), there, using the arrow keys, select New / Primary and specify the size (534.64 for me). Make the partition Bootable and select Write, after that select Quit to go back to the installation menu.

    Select the recently created partition (sda1) and click OK. Now format the partition as ext3 and install GRUB.

    When the installation asks if you want the system directory as read-write, answer Yes. Installation should not take long. You can create a fake SD card, I created an 128 MiB one. You can skip this step and select reboot.

    Now that installation is done you can shutdown the VM, go to settings and remove the ISO from the settings menu, and start it again.

     

     

    From the GRUB menu above, select Debug Mode to configure the screen resolution, here I created a 480×750 entry to better simulate a smartphone screen. To do this you need to run these commands:

    mount -o remount,rw /mnt
    cd /mnt/grub
    vi menu.lst

     

    This will open GRUB’s menu configuration with the default entries, you need to create a new entry with these options:

    title Android-x86 2.3 Smartphone
            kernel /android-2.3-RC1/kernel quiet root=/dev/ram0 androidboot_hardware=eeepc acpi_sleep=s3_bios,s3_mode DPI=160 UVESA_MODE=480x800 SRC=/android-2.3-RC1 SDCARD=/data/sdcard.img
     

    To go to edit mode on vi use the Insert key (to go to insert mode). After inserting the above lines save the file to disk: press Escape (to leave insert mode), then write :wq on the bottom command line.

    Now you need to umount the disk and reboot your VM, to do this execute these comands:

    cd /
    umount /mnt
    reboot -f

     

    And Done! Now let’s go to some needed adjustments…

    After a couple seconds you’ll be greeted with Android’s home screen. Click on the VM screen, if the cursor don’t show up press  Right CTRL + i, click on the application menu icon and go to Settings. There, enable the Ethernet adapter. To go back to the home screen press Win Key, to go back one screen press Esc. To show the options menu press F2.

     

     

    If you choose NAT you’re ready to go, if you choose Bridged you need to get the VM’s IP, so press ALT + F1 to go to the Busybox prompt and execute netcfg.

    Your network configuration will be printed to the console, to go back to the user interface press ALT + F7.

     

     

    Now you need to connect adb to be able to use the emulator from Eclipse.

    Open a console and go to android sdk home/platform-tools, once there execute this for NAT:

    adb connect 127.0.0.1

     

    If you set networking as Bridged Adapter, execute this:

    adb connect your-android-ip-see-netcfg-step-above
     

    Done with the adjustments :)

    Now go to Eclipse and run your project as an Android Application, if the device selection screen doesn’t show up go to Run Configurations and set the Android Launcher to use Manual selection.

     

     

    Dpne! (for real this time)

    I usually test using the official emulator once just to make sure everything is OK.

    You can also download older versions of android from the android-x86 project website to simulate other devices. Hope it helps, if you have any problems let me know in the comments section :)



    ---------------------------------------------------------
    專注移動開發

    Android, Windows Mobile, iPhone, J2ME, BlackBerry, Symbian
    posted on 2011-11-21 08:54 TiGERTiAN 閱讀(1070) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 久久久久久精品免费看SSS | 91福利免费体验区观看区| 国产精品免费高清在线观看| 99久久久国产精品免费牛牛 | 国产一区二区三区免费在线观看 | 免费观看国产小粉嫩喷水| 久久精品乱子伦免费| 亚洲乱码一区二区三区在线观看| 久久亚洲精品成人无码网站| 亚洲欧美成人一区二区三区| 久久无码av亚洲精品色午夜| 亚洲国产精品无码AAA片| 污污视频网站免费观看| 污视频在线免费观看| 日本黄色免费观看| 国产亚洲精品观看91在线| 和老外3p爽粗大免费视频| 成年人网站免费视频| 国产亚洲精品不卡在线| 国产精品高清视亚洲一区二区 | 亚洲日本在线观看网址| 在线观看免费黄网站| 国产麻豆免费观看91| 亚洲一区综合在线播放| 九九久久国产精品免费热6| 性做久久久久久久免费看| 亚洲AV无码一区二区二三区入口 | 免费成人在线电影| 国产成人精品日本亚洲专区61 | 日本a级片免费看| 大妹子影视剧在线观看全集免费| 国产无遮挡吃胸膜奶免费看视频| 日本高清免费中文在线看| 日韩亚洲欧洲在线com91tv| av无码免费一区二区三区| 自拍偷自拍亚洲精品播放| 韩国二级毛片免费播放| 亚洲熟女综合色一区二区三区| 久久99热精品免费观看牛牛| 色天使亚洲综合在线观看| 亚洲一区二区视频在线观看|