Start google android emulator

Android Emulator

In this document

See also

The Android SDK includes a mobile device emulator — a virtual mobile device that runs on your computer. The emulator lets you develop and test Android applications without using a physical device.

This document is a reference to the available command line options and the keyboard mapping to device keys. For a complete guide to using the Android Emulator, see Using the Android Emulator.

Keyboard Commands

Table 1 summarizes the mappings between the emulator keys and the keys of your keyboard.

Table 1. Emulator keyboard mapping

Emulated Device Key Keyboard Key
Home HOME
Menu (left softkey) F2 or Page-up button
Star (right softkey) Shift-F2 or Page Down
Back ESC
Call/dial button F3
Hangup/end call button F4
Search F5
Power button F7
Audio volume up button KEYPAD_PLUS, Ctrl-F5
Audio volume down button KEYPAD_MINUS, Ctrl-F6
Camera button Ctrl-KEYPAD_5, Ctrl-F3
Switch to previous layout orientation (for example, portrait, landscape) KEYPAD_7, Ctrl-F11
Switch to next layout orientation (for example, portrait, landscape) KEYPAD_9, Ctrl-F12
Toggle cell networking on/off F8
Toggle code profiling F9 (only with -trace startup option)
Toggle fullscreen mode Alt-Enter
Toggle trackball mode F6
Enter trackball mode temporarily (while key is pressed) Delete
DPad left/up/right/down KEYPAD_4/8/6/2
DPad center click KEYPAD_5
Onion alpha increase/decrease KEYPAD_MULTIPLY(*) / KEYPAD_DIVIDE(/)

Command Line Parameters

The emulator supports a variety of options that you can specify when launching the emulator, to control its appearance or behavior. Here’s the command-line syntax of the options available to the emulator program:

Table 2. Emulator command line parameters

-datadir

—> -image

—>

-system

—>

-mic

—>

Important: When using this option, make sure it is the last option specified, since all options after it are interpretted as qemu-specific options.

Источник

Creating an Android Emulator

An Android emulator is an Android Virtual Device (AVD) that represents a specific Android device. You can use an Android emulator as a target platform to run and test your Android applications on your PC.

  • Using Android emulators is optional.
  • An Android emulator is installed by default during the RAD Studio installation.
    • We recommend that you install this emulator during product installation.
    • This emulator is used as the default target for an Android application, so you can easily create and run an Android application on your development system.
  • If you create your own Android emulator, consider creating an emulator for each Android device you want to support.
  • RAD Studio supports the following targets:
    • Android emulators that are version 4.0 or newer
    • Android devices that are ARM version 7 or newer
  • You cannot use an Android emulator on a Virtual Machine (VM). Although an emulator might run on a VM, the emulator will not run an application.
  • It is a well-known performance issue that Android emulators are extremely slow.

The installed Android emulator is named rsxe5_android, which uses the WVGA800 skin and Android 4.2.2.

Installing an Android System Image (Required)

Before you create an Android emulator, you need to install an Android system image that your emulators can use.

Note: If you installed the Android SDK and NDK during RAD Studio installation, a valid Android system image (such as Android 4.2.2 API 17) should already be shown as Installed in the Android SDK Manager. In this case, you do not need to install another Android system image.

Follow these steps:

  1. Start the Android SDK Manager (select Start | All Programs | Embarcadero RAD Studio | Android Tools ).
  2. In the packages tree, locate and check the ARM EABI v7a System Image node within the first Android node in the list. For example: Android 4.2.2 (API 17) or Android 4.3 (API 18)
  3. Click Install 1 package. (Clear any checkboxes that were auto-selected.)
  4. In the Choose Packages to Install page, click Accept License, and then click Install to install the system image.

Creating an Android Emulator Using the Android Virtual Device Manager

To create an Android emulator on your system, follow these steps:

  1. Start the Android SDK Manager (select Start | All Programs | Embarcadero RAD Studio | Android Tools).
  2. In the Android SDK Manager, select Tools | Manage AVDs.

In the Android Virtual Device Manager, click the New button to create a new virtual device.

  • In the Create new Android Virtual Device (AVD) dialog box, select an Android device to emulate, and enter the details describing the Android device you want to emulate. In order to run a FireMonkey mobile application, your Android emulator must meet the following requirements:
    1. In Target, select an Android SDK with an API level that is 17 or higher. The drop-down list contains your installed versions of the Android SDK.
    2. Under Emulation Options, check Use Host GPU.
    3. In Device, select the Android device to emulate.

    Tip: Emulating an older Android device like the Nexus S might be faster than emulating a newer, larger device like the Nexus 10.

  • Click OK twice to create your new Android emulator.
  • You can now view your emulator in the Android Virtual Device Manager.
  • RAD Studio lists your Android emulators in the Project Manager, within the Target node of the Android target platform node. See Using the Target Node.

    Creating an Android Emulator Using the Command Line

    You can create an Android emulator in the command window by entering a command such as this:

    For the skin, you might want to add this option:

    Starting an Android Emulator

    When the emulator is the current target platform, you do not have to start the emulator before running your Android app on the emulator. However, we recommend that you start your Android emulator separately, perhaps before you start RAD Studio. Emulators are notoriously slow to start and to run, so starting the emulator beforehand means that your app can get to the emulator more quickly.

    The recommended way to start an Android emulator is by using the Android Virtual Device Manager, which can be started from the Android SDK Manager.

    To start an Android emulator such as the default emulator installed in RAD Studio:

    1. Start the Android SDK Manager (select Start | All Programs | Embarcadero RAD Studio | Android Tools).
    2. In the Android SDK Manager, click the Tools menu and select Manage AVDs.
    3. In the Android Virtual Device Manager, select the emulator and click Start.

  • Then click Launch on the Launch Options dialog box.
  • Your emulator should now start (this might take five or ten minutes):

    In the Project Manager, your emulator should appear in the Target node of the Android target platform:

    Tip: If the Project Manager does not show your running Android emulator as running, with the same icon as in the screenshot above, see Using the Target Node.

    Your next step is to run an Android app on your emulator. In the Project Manager, ensure that the emulator’s name is in boldface and the port number is indicated in parentheses (such as (5554)), indicating that the emulator is running and is the current selected target platform.

    Источник

    Читайте также:  Как удалить весь google с android
    Оцените статью
  • Category Option Description Comments
    AVD -avd or
    @
    Required. Specifies the AVD to load for this emulator instance. You must create an AVD configuration before launching the emulator. For information, see Managing AVDs with AVD Manager.
    Disk Images -cache Use as the working cache partition image. An absolute or relative path to the current working directory. If no cache file is specified, the emulator’s default behavior is to use a temporary file instead.

    For more information on disk images, use -help-disk-images .

    -data Use as the working user-data disk image. Optionally, you can specify a path relative to the current working directory. If -data is not used, the emulator looks for a file named userdata-qemu.img in the storage area of the AVD being used (see -avd ).
    Search for the user-data disk image specified in -data in is a path relative to the current working directory.

    If you do not specify -datadir , the emulator looks for the user-data image in the storage area of the AVD being used (see -avd )

    For more information on disk images, use -help-disk-images .

    Use as the system image. Optionally, you can specify a path relative to the current working directory. Default is /system.img.
    -initdata When resetting the user-data image (through -wipe-data ), copy the contents of this file to the new user-data disk image. By default, the emulator copies the /userdata.img . Optionally, you can specify a path relative to the current working directory. See also -wipe-data .

    For more information on disk images, use -help-disk-images .

    -nocache Start the emulator without a cache partition. See also -cache .
    -ramdisk Use as the ramdisk image. Default value is /ramdisk.img .

    Optionally, you can specify a path relative to the current working directory. For more information on disk images, use -help-disk-images .

    -sdcard Use as the SD card image. Default value is /sdcard.img .

    Optionally, you can specify a path relative to the current working directory. For more information on disk images, use -help-disk-images .

    Search for system, ramdisk and user data images in . is a directory path relative to the current working directory.
    -wipe-data Reset the current user-data disk image (that is, the file specified by -datadir and -data , or the default file). The emulator deletes all data from the user data image file, then copies the contents of the file at -inidata data to the image file before starting. See also -initdata .

    For more information on disk images, use -help-disk-images .

    Debug -debug Enable/disable debug messages for the specified debug tags. is a space/comma/column-separated list of debug component names. Use -help-debug-tags to print a list of debug component names that you can use.
    -debug- Enable/disable debug messages for the specified debug tag. Use -help-debug-tags to print a list of debug component names that you can use in .
    -debug-no- Disable debug messages for the specified debug tag.
    -logcat Enable logcat output with given tags. If the environment variable ANDROID_LOG_TAGS is defined and not empty, its value will be used to enable logcat output by default.
    -shell Create a root shell console on the current terminal. You can use this command even if the adb daemon in the emulated system is broken. Pressing Ctrl-c from the shell stops the emulator instead of the shell.
    -shell-serial Enable the root shell (as in -shell and specify the QEMU character device to use for communication with the shell. must be a QEMU device type. See the documentation for ‘-serial dev‘ at http://wiki.qemu.org/download/qemu-doc.html for a list of device types.

    Here are some examples:

    • -shell-serial stdio is identical to -shell
    • -shell-serial tcp::4444,server,nowait lets you communicate with the shell over TCP port 4444
    • -shell-serial fdpair:3:6 lets a parent process communicate with the shell using fds 3 (in) and 6 (out)
    • -shell-serial fdpair:0:1 uses the normal stdin and stdout fds, except that QEMU won’t tty-cook the data.
    -show-kernel Display kernel messages.
    -trace Enable code profiling (press F9 to start), written to a specified file.
    -verbose Enable verbose output. Equivalent to -debug-init .

    You can define the default verbose output options used by emulator instances in the Android environment variable ANDROID_VERBOSE. Define the options you want to use in a comma-delimited list, specifying only the stem of each option: -debug- .

    Here’s an example showing ANDROID_VERBOSE defined with the -debug-init and -debug-modem options:

    For more information about debug tags, use .

    Media -audio Use the specified audio backend.
    -audio-in Use the specified audio-input backend.
    -audio-out Use the specified audio-output backend.
    Use device or WAV file for audio input.
    -noaudio Disable audio support in the current emulator instance.
    -radio Redirect radio modem interface to a host character device.
    -useaudio Enable audio support in the current emulator instance. Enabled by default.
    Network -dns-server Use the specified DNS server(s). The value of must be a comma-separated list of up to 4 DNS server names or IP addresses.
    -http-proxy

    Make all TCP connections through a specified HTTP/HTTPS proxy The value of

    can be one of the following:
    http:// :

    The http:// prefix can be omitted. If the -http-proxy

    command is not supplied, the emulator looks up the http_proxy environment variable and automatically uses any value matching the

    format described above.

    -netdelay Set network latency emulation to . Default value is none . See the table in Network Delay Emulation for supported values.
    -netfast Shortcut for -netspeed full -netdelay none
    -netspeed Set network speed emulation to . Default value is full . See the table in Network Speed Emulation for supported values.
    -port

    Set the console port number for this emulator instance to

    .

    The console port number must be an even integer between 5554 and 5584, inclusive.

    +1 must also be free and will be reserved for ADB.

    -report-console Report the assigned console port for this emulator instance to a remote third party before starting the emulation. must use one of these formats:

    to view more information about this topic.

    System -cpu-delay Slow down emulated CPU speed by Supported values for are integers between 0 and 1000.

    Note that the does not correlate to clock speed or other absolute metrics — it simply represents an abstract, relative delay factor applied non-deterministically in the emulator. Effective performance does not always scale in direct relationship with values.

    -gps Redirect NMEA GPS to character device. Use this command to emulate an NMEA-compatible GPS unit connected to an external character device or socket. The format of must be QEMU-specific serial device specification. See the documentation for ‘serial -dev’ at http://wiki.qemu.org/download/qemu-doc.html.
    -nojni Disable JNI checks in the Dalvik runtime.
    -qemu Pass arguments to the qemu emulator software.