Linux is not perfect to improve the startup speed of Android virtual machine __linux

Source: Internet
Author: User

Last year double A new computer, Asus vivo4000, configuration is not very good, 4k screen: 3840x2160, 940M graphics card, Core i7 CPU, 8G of memory, hard drive is 1T mechanical hard drive, in addition to the basic sense of hard disk can be. The system is WIN10 home version, a bit uncomfortable, and later redistribution of their own hard disk partition, installed my favorite Manjaro Linux, almost every day update. Linux is not a bit more cool than WINDOW10. Ha ha. Okay, here we go. Roman:

(1) Core i7 support VT Technology, many online tutorials are installed under Windows HAXM Drive, and then to the Intel official website, found that there is a window version of the Mac version of Linux, Linux has been enabled by default

(2) After more than n verification, it is found that the virtual machine startup will be in the/home/xxxxx/.android/avd/(virtual machine directory) to create a directory, the name is metrics, if there is no file in this directory and its directory, start normal

(3) My solution is to start the virtual machine after removing the directory every time the virtual machine is started. Fast, up to 20s to start.

(4) One drawback of this solution is that each time you want to delete a directory and start the Android virtual machine in the android/tools/directory, my solution is to add the android/tools/directory to the/etc/profile file. So the document reads as follows: Path= ".:/ usr/local/sbin:/usr/local/bin:/usr/bin:/home/michelle/workm/android_sdk/tools/", note that there is a". "At the front. The directory means the current directory. Using commands: Emulator64-x86-avd nbandroidvm-qemu-m 2047-ENABLE-KVM, this command is a bit more complicated, say: emulator64-x86 the command to start the virtual machine-AVD NBANDROIDVM Option followed by the name of the virtual machine-qemu boot acceleration-m 2047 specifies that the memory is 2047 and cannot be set to 2048, otherwise it will not start-ENABLE-KVM the last one is a virtual technology using Linux, and then simply bang: Write a script that reads as follows:

#!/bin/bash
rm-rf/home/michelle/.android/avd/metrics/
echo "Delete directory succeeded"
EMULATOR64-X86-AVD nbandroidvm-qemu-m 2047-ENABLE-KVM

You can save the above 4 lines in a startavd.sh script file, chmod +x startavd.sh, add the script to the executable property, then double-click the script to start the virtual machine, or use SH startavd.sh to start the virtual machine.

(5) In order to secure the period, the cancellation, you can enjoy the feeling of flying general.

My virtual machine configuration file: Config.ini

Avd.ini.encoding=utf-8//Coding
Abi.type=x86//virtual machine type
disk.datapartition.size=2048m//Partition size
Hw.accelerometer=yes
Hw.audioinput=yes
Hw.battery=yes
Hw.camera.back=none
Hw.camera.front=none
Hw.cpu.arch=x86//CPU Architecture
Hw.dpad=yes//Enable direction key, up and down medium
Hw.device.hash2=md5:6930e145748b87e87d3f40cabd140a41
Hw.device.manufacturer=google
Hw.device.name=nexus 4//virtual machine name
Hw.gps=yes
Hw.keyboard=yes//One line of keys containing the power button, three
hw.lcd.density=320
Hw.mainkeys=yes//A one-line key containing the home keys
hw.ramsize=2048//virtual machine memory
Hw.sdcard=yes
Hw.sensors.orientation=yes
Hw.sensors.proximity=yes
Hw.trackball=no
image.sysdir.1=system-images/android-19/default/x86/
sdcard.size=1024m
Skin.dynamic=yes
skin.name=768x1280
skin.path=768x1280
Tag.display=default
Tag.id=default
Vm.heapsize=64

Hardware-qemu.ini content is as follows

Hw.cpu.arch = x86
Hw.cpu.model = qemu32
Hw.ramsize = 2048
Hw.screen = Touch
Hw.mainkeys = yes
Hw.trackball = No
Hw.keyboard = yes
Hw.keyboard.lid = No
Hw.keyboard.charmap = Qwerty2
Hw.dpad = yes
Hw.gsmmodem = yes
Hw.gps = yes
Hw.battery = yes
Hw.accelerometer = yes
Hw.audioinput = yes
Hw.audiooutput = yes
Hw.sdcard = yes
Hw.sdCard.path =/home/michelle/.android/avd/nbandroidvm.avd/sdcard.img
Disk.cachepartition = yes
Disk.cachePartition.path =/home/michelle/.android/avd/nbandroidvm.avd/cache.img
Disk.cachePartition.size = 66m
Hw.lcd.width = 768
Hw.lcd.height = 1280
Hw.lcd.depth = 16
Hw.lcd.density = 320
Hw.lcd.backlight = yes
hw.gpu.enabled = No
Hw.initialorientation = Portrait
Hw.camera.back = None
Hw.camera.front = None
Vm.heapsize = 64
Hw.sensors.proximity = yes
Hw.sensors.magnetic_field = yes
Hw.sensors.orientation = yes
Hw.sensors.temperature = yes
HW.USEEXT4 = yes
Kernel.path =/home/michelle/workm/android_sdk/system-images/android-19/default/x86//kernel-qemu
Kernel.parameters = Androidboot.hardware=goldfish Clocksource=pit android.checkjni=1
kernel.newdevicenaming = No
KERNEL.SUPPORTSYAFFS2 = yes
Disk.ramdisk.path =/home/michelle/workm/android_sdk/system-images/android-19/default/x86//ramdisk.img
Disk.systemPartition.initPath =/home/michelle/workm/android_sdk/system-images/android-19/default/x86// System.img
Disk.systemPartition.size = 550m
Disk.dataPartition.path =/home/michelle/.android/avd/nbandroidvm.avd/userdata-qemu.img
Disk.dataPartition.size = 2g
Avd.name = NBANDROIDVM
Please change your own Android virtual machine to fly, as appropriate.




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.