<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)  編輯  收藏

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


    網站導航:
     
    主站蜘蛛池模板: 在线播放国产不卡免费视频| 精品无码国产污污污免费网站国产| 亚洲国产成人精品无码区在线网站| 久久精品国产亚洲AV电影| 国产在线播放线91免费 | 粉色视频免费入口| 99久久国产精品免费一区二区| 久久久久亚洲?V成人无码| 亚洲www77777| 可以免费观看的国产视频| 全亚洲最新黄色特级网站 | 亚洲精品国产成人99久久| 最近2019中文免费字幕在线观看 | 亚洲视频欧洲视频| 一区免费在线观看| 亚洲日本va中文字幕久久| 国产精品99精品久久免费| 亚洲黄色在线观看视频| 成人无码区免费A片视频WWW| 国产亚洲av片在线观看18女人| 中文无码日韩欧免费视频| 亚洲第一成年男人的天堂| 久久一区二区免费播放| 日韩亚洲一区二区三区| 免费在线人人电影网| 2021久久精品免费观看| 亚洲第一成年男人的天堂| 亚洲性线免费观看视频成熟| 黑人粗长大战亚洲女2021国产精品成人免费视频| 日韩中文无码有码免费视频| 亚洲国产精品综合久久20| 很黄很黄的网站免费的| 亚洲成a人无码亚洲成av无码 | 亚洲乱码日产精品a级毛片久久| 国产精品亚洲自在线播放页码 | 国产AV无码专区亚洲AWWW| 国产成人免费高清激情明星| 国产精品亚洲精品久久精品| 亚洲成色www久久网站夜月| 最新猫咪www免费人成| 日韩免费高清播放器|