Specify parameters when starting the simulator

Source: Internet
Author: User

During Android development, if you use a simulator to run a program, you can adjust the running of the simulator by specifying some parameters, such as the interface size of the simulator and the memory size allocated to the simulator during running.

At first, because I didn't allocate enough memory to the simulator, I often terminated abnormally when running the simulator.

The following sections describe how to set and create a virtual device in eclipse through the command line.

1. Specify emulator-AVD android2.2-scale 0.9-memory 256 when starting the simulator on the command line.

-AVD specifies the virtual device name,-scale specifies the interface size, and-memory 256 specifies the memory allocated to the simulator.

2. Specify the following when running the android project in Eclipse:

Choose run> RUN configurations> Target> emulator launch parameters to select the skin.
In the "Additional emulator command line options", you can enter-scale -- to zoom in the simulator window. Fill in-memory 256 to specify the allocated memory.

3. When creating a virtual device, specify: In 'properties' -- "'new', select 'device Ram size', and fill in the value.

Other parameters are listed below:

-Sysdir <dir> is used to search the system hard disk image in the <dir> directory of the simulator.
-System <File> reads the initialization system image from the <File> file of the simulator.
-Datadir <dir> specifies the directory for Writing user data.
-Kernel <File> used the specified simulator kernel for the simulator settings
-Ramdisk <File> sets the Memory RAM image file (default value: <system>/ramdisk. IMG)
-Image <File> obsolete, replaced by-System <File>
-Init-data <File> sets the initialization data image (<system>/userdata. IMG by default)
-Initdata <File> and "-init-data <File>" are used in the same way.
-Data <File> sets the data image (default: <datadir>/userdata-qemu.img)
-Partition-size <size> system/Data Partition capacity (MB)
-Cache <File> sets the simulator to cache the partition image (default value: 0 file)
-No-Cache: Disable cache partitions.
-Nocache and "-no-Cache" are used in the same way.
-Sdcard <File> specifies the simulator sdcard image file (default: <system>/sdcard. IMG)
-Wipe-data clear and reset the user data image (copy from initdata)
-AVD <Name> specifies the android virtual device used by the simulator.
-Skindir <dir> sets the simulator skin to search for skin in the <dir> directory (default: <system>/skins directory)
-Skin <Name> select to use the given skin
-No-skin is not applicable to any simulator skin.
-Noskin is used in the same way as "-no-skin ".
-Memory <size> physical RAM memory size (MB)
-Netspeed <speed> sets the maximum network download and upload speeds.
-Netdelay <delay> network latency Simulation
-Netfast: Disable the network type
-Tarce <Name> code configuration is available
-Show-kernel: displays kernel information
-Shell: Use the root shell command on the current terminal
-Disable JNI detection when no-JNI Dalvik is running
-Nojni is used in the same way as "-no-JNI ".

-Logcat <tag> outputs the logcat information of the given tag.

-No-Audio: Disable audio support
-The usage of noaudio is the same as that of "-no-Audio ".
-Audio <backend> uses the specified audio backend.
-Audio-in <backend> uses the specified input audio backend.
-Audoi-out <backend> use the specified output audio backend
-Disable Unicode keyboard flip for raw-keys
-Radio redirects wireless mode interfaces to personalized devices
-Port <port> set the TCP port used by the Console
-Ports <consoleport> and <adbport> set the TCP port used by the console and the TCP port used by the ADB debugging bridge.
-Onion <image> overwrite PNG images on the upper layer of the screen
-Onion-Alpha <% age> specifies the upper-layer skin transparency
-Onion-rotation 0 | 1 | 2 | 3 specifies upper skin Rotation
-Scale <scale> adjusts the size of the simulator window (three types: 1.0-3.0, DPI, and auto)
-DPI-device <DPI> sets the device's resolution (DPI Unit) (default: 165)
-Http-proxy <proxy> creates a TCP connection through an HTTP or HTTPS Proxy
-Timezone <timezone> uses the given time zone instead of the default
-DNS-server <Server> use the given DNS service on the Simulation System
-CPU-delay <cpudelay> adjusts the CPU Simulation
-No-boot-anim: Disable animation for Quick Start
-No-window disable graphical window display
-Version: displays the Simulator version.
-Report-console <socket> report Console port to remote socket
-GPS <device> redirects GPS to a personalized device.
-Keyset <Name> specifies the key to set the file name.
-Shell-serial <device> personalized device of the root shell
-Old-system supports system images of earlier versions (pre 1.4)
-Tcpdump <File> captures network packets to files.
-Bootchart <timeout> bootcharting is available.
-Qemu ARGs... pass parameters to qemu
-Qemu-H: Display qemu help
-Verbose and "-debug-init" are the same
-Debug <tags> available and disabled debugging information
-Debug-<tag> make the specified debugging information available
-Debug-no-<tag> disable the specified debugging information.
-Help: print the help document.
-Help-<option> Print the help document of the specified option.
-Help-disk-images help for Hard Disk Images
-Help-keys supports button bundling (mobile phone shortcut keys)
-Help-debug-tags: displays the optional tag values in the-Debug <tag> command.
-Help-Char-devices personalized device description
-Help-environment variables
-Help-keyset-file: Specifies the Key Binding setting file
-Help-virtula-device virtual device management

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.