第03讲:Android模拟器的使用
Android模拟器的使用

Android模拟器的使用在讲新的知识前让我们一起学习一下模拟器的使用。
本节内容如下:模拟器和真机的比较创建Android模拟器(emulator)运行Android模拟器设置简体中文语言界面模拟手机拨打电话和发送短信的功能源代码:本讲没有代码模拟器和真机的比较android模拟器不具备的功能:不支持呼叫和接听实际来电;但可以通过控制台模拟电话呼叫(呼入和呼出)不支持USB连接不支持相机/视频捕捉不支持音频输入(捕捉);但支持输出(重放)不支持扩展耳机不能确定连接状态不能确定电池电量水平和交流充电状态不能确定SD卡的插入/弹出不支持蓝牙。
模拟器具备的独特功能:api demo,这个API演示主要是ui部分,各种简单的控件使用技巧在里面都可以找到,dev tools,在dev tools可以获取到一些debug时需要的信息。
创建模拟器运行SDK目录中的sdk setup.exe文件,点击左侧Virtual Devices选项卡,点击New…在新弹出的窗口里填写:name: 2.2_hvga (给虚拟机起个名字)Target: 2.2 选择版本SD card:128MB 存储卡内存多少兆Skin:模拟器外观和屏幕尺寸Hardware:支持的硬件设备创建模拟器的视频操作可以参见本博客的:第三讲视频,创建模拟器。
运行Android模拟器命令行中运行Android模拟器的命令emulator.exe –avd 2.2_432其中–avd 的意思是android virtual driver (安卓虚拟设备)2.2_432 是模拟器的名字,2.2是版本号,432是设备分辨率Android模拟器的启动速度很慢,大约需要2-3分钟,等待的时候不要担心有什么问题。
下面是启动成功的画面。
要注意的是用的模拟器不同,画面风格也会不同。
为模拟器设置简体中文界面Home -> setting -> Language & keyboard ->select language具体操作见第三讲视频文件:为Android模拟器设置简体中文界面。
安卓模拟器

简介
安卓模拟器是能在PC平台模拟安卓手机系统的模拟器软件。安卓模拟器能在电脑上模拟出安卓手机运行环境, 安卓模拟器让你在电脑上也能体验安卓游戏和应用,在各大下载站都能够下载。
比较常用的安卓模拟器有:Android SDK、BlueStacks,可在pc系统和苹果系统运行,著名的vmware虚拟机 和Virtual Box虚拟机也可以模拟安卓系统,目前这些模拟器软件均可运行在微软公司的Windows操作系统平台。
安卓模拟器
在电脑上模拟安卓系统的软件
01 简介
03 安装方法
目录
02 产品介绍 04 特点
安卓模拟器是能在个人计算机运行并模拟安卓手机系统的模拟器,并能安装、使用、卸载安卓应用的软件, 利用安卓模拟器,用户即使没有手机硬件设备,也能在模拟器中使用移动应用程序。安卓模拟器能在电脑上模拟 出安卓手机运行环境,让用户在电脑上也能体验安卓游戏和应用。安卓模拟器是移动游戏市场的快速发展逐渐形 成的一个独立行业。
安卓模拟器作为一种全新的游戏平台,具有如下的特点:
(1)永久在线,安卓模拟器解决了安卓手机的续航电量问题及发热问题。
(2)多开功能。一般用户同时拥有多台安卓手机的可能性很小,但是只要PC端内存只够大。就可以运行多 个模拟器达到多开的效果。
(3)操作便捷。智能机操作一般为左右拇指进行操作,而安卓模拟器通过键盘映射来模拟手指的点击和拖动, 比一般智能机用左右拇指进行触屏操作更加的便捷顺心。
怎么使用安卓模拟器玩手机游戏

怎么使用安卓模拟器玩手机游戏逍遥安卓模拟器是目前在虚拟化技术上优化最好的安卓模拟器,全自研的逍遥引擎在性能和兼容性较其他同类产品好很多,可以让用户在电脑上玩畅玩手游,游戏账号在PC和手机上互通。
逍遥安卓模拟器是目前新增用户使用最多、最受欢迎、忠诚度最高的安卓模拟器,其强大的性能、无广告的绿色环境、巨大的潜力以及极致的用户体验为逍遥安卓模拟器赢得了广泛的赞誉,赢得了千万用户的青睐。
针对很多用户可能是第一次使用逍遥安卓模拟器,为了让所有还不会熟练使用安卓模拟器的用户能够尽快熟练地畅玩各种安卓应用,我们将一些安卓模拟器的基本使用方法进行了总结!一、为了避免遇到病毒及木马,请从逍遥安卓模拟器官方下载软件二、软件下载好之后会在线自动安装,只需点击下一步即可。
安装好之后直接启动,无需进行任何设置,纯粹绿色的安卓环境,性能完全超越主流手机,畅玩你想要的各种手游!玩QQ游戏的请一定要在模拟器内下载一个QQ,这样登录游戏不会报错!三、逍遥安卓模拟器中可以直接下载所有的游戏及应用,且自动安装,大家可以在逍遥安卓中进行选购。
四、如何用键盘鼠标在电脑安卓模拟器上操控手游在电脑大屏幕上用键盘鼠标玩手游,可以更精准地操控游戏,获得更好的游戏体验。
但是很多用户还是不太会使用,操作规范如下:1、要想用鼠标和键盘控制安卓模拟器的游戏,请一定在进入你要玩的游戏后点右侧侧小键盘,打开键盘映射。
2、枪战类手游的设置方式:控制走位的用WASD八方向键,设计的视角用准星键可以用鼠标移动枪械视角,射击键就用子弹形状的射击键,其他比如跳跃、换枪、换子弹等动作在需要手机触屏的地方用鼠标左键点一下然后在跳出的圆圈内设置一个键盘上的按键(保存好之后点击鼠标右键生效,然后可以用鼠标的移动来调整射击视角,点鼠标左键射击,点WASD键走位,点你设置好的键来更换子弹及跳跃等)。
3、MOBA类手游设置方式:移动键用WASD八方位键,其他的键那边需要的就用鼠标左键点一下然后设置一个键盘按键。
Android模拟器Emulator超详细使用说明

Android模拟器Emulator超详细使用说明Android SDK自带一个移动设备模拟器—它是一个可以运行在你电脑上的虚拟设备. Android模拟器可以让你不需使用物理设备即可预览、开发和测试Android应用程序.Android模拟器能够模拟除了接听和拨打电话外的所有移动设备上的典型功能和行为. 如右图所示,Android模拟器提供了大量的导航和控制键,你可以通过鼠标或键盘点击这些按键来为你的应用程序产生事件.同时它还有一个屏幕用于显示Android自带应用程序和你自己的应用程序.为了便于模拟和测试应用程序, Android模拟器允许你你的应用程序通过Android平台服务调用其他程序、访问网络、播放音频和视频、保存和接收数据、通知用户、渲染图像过渡和场景.Android模拟器同样具有强大的调试能力,例如能够记录内核输出的控制台、模拟程序中断(比如接受短信或打入电话)、模拟数据通道中的延时效果和遗失。
下面的章节将提供关于模拟器的详细信息,以及如何在开发应用程序中使用模拟器。
启动和关闭模拟器要启动Android模拟器,首先进入SDK的DE>tools/DE>文件夹,然后输入 DE>emulatorDE> 或 DE>./emulatorDE>。
这个操作将初始化Android系统,你将会在屏幕上看到模拟器窗口。
要关闭模拟器,只需要关闭模拟器窗口即可。
操作模拟器你可以通过模拟器的启动选项和控制台命令来控制模拟环境的行为和特性。
一旦模拟器启动,你就可以通过键盘和鼠标来”按” 模拟器的按键,从而操作模拟器。
下面的表格总结了模拟器按键可键盘按键之间的映射关系。
模拟器启动选项Android模拟器提供了很多启动选项,你可以在启动模拟器时指定,来控制其外观和行为。
下面是用命令行的方式启动模拟器并指定参数的语法:emulator [-option [value]] ... [-qemu args]下表总结了所有有效的选项。
Android模拟器使用手册

Image of the Android EmulatorThe Android SDK includes a mobile device emulator — a virtual mobile device that runs on your computer. The emulator lets you prototype, develop, and test Android applications without using a physical device.The Android emulator all of the hardware and software features of a typical mobile device, except that it can not receive or place actual phone calls. It provides a variety of navigation and control key s, which you can “press” using your mouse or keyboard to generate events for your application. It also provides a screen in which your application is displayed, together with any other Android applications running.To let you model and test your application more easily, the emulator supports Android Virtual Device (AVD) configurations. AVDs let you specify the Android platform that you want to run on the emulator, as well as the hardware options and emulator skin files tht you want to use. Once your application is running on the emulator, it can use the services of the Android platform to invoke other applications, access the network, play audio and video, store and retrieve data, notify the user, and render graphical transitions and themes.The emulator also includes a variety of debug capabilities, such as a console from which you can log kernel output, simulate application interrupts (such as arriving SMS messages or phone calls), and simulate latency effects and dropouts on the data channel.In this document:1. Overview2. Starting and Stopping the Emulator3. Android Virtual Devices and the Emulator4. Controlling the Emulator5. Emulator Startup Options6. Working with Emulator Disk Images1. Default Images2. Runtime Images: User Data and SD Card3. Temporary Images7. Emulator Networking1. Network Address Space2. Local Networking Limitations3. Using Network Redirections4. Configuring the Emulator‟s DNS Settings5. Using the Emulator with a Proxy6. Interconnecting Emulator Instances7. Sending a Voice Call or SMS to Another Emulator Instance1. Using the Emulator Console1. Port Redirections2. Geo Location Provider Emulation3. Sending Events4. Emulating Device Power Characteristics5. Network Status6. Network Delay Emulation7. Network Speed Emulation8. Telephony Emulation9. SMS Emulation10. VM State11. Emulator Window12. Terminating an Emulator Instance2. Using Emulator Skins3. Running Multiple Instances of the Emulator4. Installing Applications on the Emulator5. SD Card Emulation1. Creating an SD card image using the android tool2. Creating an SD card image using mksdcard3. Copying Files to a Disk Image4. Loading the Disk Image at Emulator Startup6. Troubleshooting Emulator Problems7. Emulator LimitationsOverviewThe Android emulator is a QEMU-based application that provides a virtual ARM mobile device on which you canrun your Android applications. It runs a full Android system stack, down to the kernel level, that includes a set of preinstalled applications (such as the dialer) that you can access from your applications. You can choose what version of the Android system you want to run in the emulator by configuring AVDs, and you can also customize the mobile device skin and key mappings. When launching the emulator and at runtime, you can use a variety of commands and options to control the its behaviors.The Android system image distributed in the SDK contains ARM machine code for the Android Linux kernel, the native libraries, the Dalvik VM, and the various Android package files (such as for for the Android framework and preinstalled applications). The emulator‟s QEMU layers provide dynamic binary translation of the ARM machine code to the OS and processor architecture of your development machine.Adding custom capabilities to the underlying QEMU services, the Android emulator supports many hardware features likely to be found on mobile devices, including:* An ARMv5 CPU and the corresponding memory-management unit (MMU)* A 16-bit LCD display* One or more keyboards (a Qwerty-based keyboard and associated Dpad/Phone buttons)* A sound chip with output and input capabilities* Flash memory partitions (emulated through disk image files on the development machine)* A GSM modem, including a simulated SIM CardThe sections below provide more information about the emulator and how to use it for developing Android applications.Starting and Stopping the EmulatorDuring development and testing of your application, you install and run your application in the Android emulator. You can launch the emulator as a standalone application, from a command line, or you can use it as part of your Eclipse development environment. In either case, you specify the AVD configuration to load and any startup options you want to use, as described in this document.You can run your application on a single instance of the emulator or, depending on your needs, you can start multiple emulator instances and run your application in more than one emulated device. You can use the emulator‟s built-in commands to simulate GSM phone calling or SMS between emulator instances, and you can set up network redirections that allow emulators to send data to one another. For more information, see Telephony Emulation, SMS Emulation, and Emulator NetworkingTo start an instance of the emulator from the command line, change to the tools/ folder of the SDK. Enter emulator command like this:emulator -avdThis initializes the emulator and loads an AVD configuration (see the next section for more information about AVDs). You will see the emulator window appear on your screen.If you are working in Eclipse, the ADT plugin for Eclipse installs your application and starts the emulator automatically, when you run or debug the application. You can specify emulator startup options in the Run/Debug dialog, in the Target tab. When the emulator is running, you can issue console commands as described later in this document.If you are not working in Eclipse, see Installing Applications on the Emulator for information about how to install your application.To stop an emulator instance, just close the emulator‟s window.Android Virtual Devices and the EmulatorTo use the emulator, you first must create one or more AVD configurations. In each configuration, you specify an Android platform to run in the emulator and the set of hardware options and emulator skin you want to use. Then, when you launch the emulator, you specify the AVD configuration that you want to load.To specify the AVD you want to load when starting the emulator, you use the -avd argument, as shown in the previous section.Each AVD functions as an independent device, with its own private storage for user data, SD card, and so on. When you launch the emulator with an AVD configuration, it automatically loads the user data and SD card data from the AVD directory. By default, the emulator stores the user data, SD card data, and cache in the AVD directory.To create and manage AVDs you use the android tool, a command-line utility included in the SDK. For complete information about how to set up AVDs, see Android Virtual Devices.Controlling the EmulatorYou can use emulator startup options and console commands to control the behaviors and characteristics of the emulated environment itself.When the emulator is running, you can interact with the emulated mobile device just as you would an actual mobile device, except that you use your mouse pointer to “touch” the touchscreen and your keyboard keys to“press” the simulated device keys.The table below summarizes the mappings between the emulator keys and and the keys of your keyboard. Emulated Device Key Keyboard KeyHome HOMEMenu (left softkey) F2 or Page-up buttonStar (right softkey) Shift-F2 or Page DownBack ESCCall/dial button F3Hangup/end call button F4Search F5Power button F7Audio volume up button KEYPAD_PLUS, Ctrl-5Audio volume down button KEYPAD_MINUS, Ctrl-F6Camera button Ctrl-KEYPAD_5, Ctrl-F3Switch to previous layout orientation (for example, portrait, landscape) KEYPAD_7, Ctrl-F11Switch to next layout orientation (for example, portrait, landscape) KEYPAD_9, Ctrl-F12Toggle cell networking on/off F8Toggle code profiling F9 (only with -trace startup option)Toggle fullscreen mode Alt-EnterToggle trackball mode F6Enter trackball mode temporarily (while key is pressed) DeleteDPad left/up/right/down KEYPAD_4/8/6/2DPad center click KEYPAD_5Onion alpha increase/decrease KEYPAD_MULTIPLY(*) / KEYPAD_DIVIDE(/)Note that, to use keypad keys, you must first disable NumLock on your development computer.Emulator Startup OptionsThe 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 usage for launching the emulator with options:emulator -avd [- []] … [-]The table below summarizes the available options.Category Option Description CommentsHelp -help Print a list of all emulator options.-help-all Print help for all startup options.-help-Print help for a specific startup option.-help-debug-tags Print a list of all tags for -debug .-help-disk-images Print help for using emulator disk images.-help-environment Print help for emulator environment variables.-help-keys Print the current mapping of keys.-help-keyset-file Print help for defining a custom key mappings file.-help-virtual-device Print help for Android Virtual Device usage.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 Android Virtual Devices.Disk Images -cache Use as the working cache partition image. Optionally, you can specify a path relative 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).-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.-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 /qemu/qemu-doc.html#SEC10 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: ANDROID_VERBOSE=init,modemFor more information about debug tags, use <-help-debug-tags>.Media -audio Use the specified audio backend.-audio-in Use the specified audio-input backend.-audio-out Use the specified audio-output backend.-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://: 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:tcp: [,server][,max=] unix: [,server][,max=]Use -help-report-consoleto 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 /qemu/qemu-doc.html#SEC10.-nojni Disable JNI checks in the Dalvik runtime.-qemu Pass arguments to qemu.-qemu -h Display qemu help.-radio Redirect radio mode to the specified character device. The format of must be QEMU-specific serial device specification. See the documentation for ‟serial -dev‟ at http://www.bellar /qemu/qemu-doc.html#SEC10.-timezone Set the timezone for the emulated device to , instead of the host‟s timezone. must be specified in zoneinfo format. For example:“America/Los_Angeles”“Europe/Paris”-version Display the emulator‟s version number.UI -dpi-device Scale the resolution of the emulator to match the screen size of a physical device. The default value is 165. See also -scale.-no-boot-anim Disable the boot animation during emulator startup. Disabling the boot animation can speed the startup time for the emulator.-no-window Disable the emulator‟s graphical window display.-scale Scale the emulator window. is a number between 0.1 and 3 that represents the desired scaling factor. You can also specify scale as a DPI value if you add the suffi x “dpi” to the scale value. A value of “auto” tells the emulator to select the best window size.-raw-keys Disable Unicode keyboard reverse-mapping.-noskin Don‟t use any emulator skin.-keyset Use the specified keyset file instead of the default. The keyset file defines the list of key bindings between the emulator and the host keyboard. For more information, use -help-keyset to print information about this topic. -onion Use overlay image over screen. No support for JPEG. Only PNG is supported.-onion-alpha Specify onion skin translucency value (as percent). Default is 50.-onion-rotation Specify onion skin rotation. must be one of the values 0, 1, 2, 3.-skin This emulator option is deprecated. Please set skin options using AVDs, rather than by using this emulator option. Using this option may yield unexpected and in some cases misleading results, since the density with which to render the skin may not be defined. AVDs let you associate each skin with a default density and override the default as needed. For more information, see Android Virtual Devices.-skindirThis emulator option is deprecated. See comments for -skin, above.Working with Emulator Disk ImagesThe emulator uses mountable disk images stored on your development machine to simulate flash (or similar) partitions on an actual device. For example, it uses disk image containing an emulator-specific kernel, the Android system, a ramdisk image, and writeable images for user data and simulated SD card.To run properly, the emulator requires access to a specific set of disk image files. By default, the Emulator always looks for the disk images in the private storage area of the AVD in use. If no images exist there when the Emulator is launched, it creates the images in the AVD directory based on default versions stored in the SDK.Note: The default storage location for AVDs is in ~/.android/avd on OS X and Linux, C:\Documents and Settings\\.android\ on Windows XP, and C:\Users\\.android\ on Windows Vista.To let you use alternate or custom versions of the image files, the emulator provides startup options that override the default locations and filenames of the image files. When you use the options, the emulator searches for the image file under the image name or location that you specify; if it can not locate the image, it reverts to using the default names and location.The emulator uses three types of image files: default image files, runtime image files, and temporary image files. The sections below describe how to override the location/name of each type of file.Default ImagesWhen the emulator launches but does not find an existing user data image in the active AVD‟s storage area, it creates a new one from a default version included in the SDK. The default user data image is read-only. The image files are read-only.The emulator provides the -systemstartup option to let you override the location under which the emulator looks for the default user data image.The emulator also provides a startup option that lets you override the name of the default user data image, as described in the table below. When you use the option, the emulator looks in the default directory, or in a custom location (if you specified -system).Name Description Commentsuserdata.img The initial user-data disk image Override using -initdata . Also see -data , below.Runtime Images: User Data and SD CardAt runtime, the emulator reads and writes data on two disk images: a user-data image and (optionally) an SD card image. This emulates the user-data partition and removable storage media on actual device.The emulator provides a default user-data disk image. At startup, the emulator creates the default image as a copy of the system user-data image (user-data.img), described above. The emulator stores the new image with the files of the active AVD.The emulator provides startup options to let you override the actual names and storage locations of the runtime images to load, as described in the table below. When you use one of these options, the emulator looks for the specified file(s) in the current working directory, in the AVD directory, or in a custom location (if you specified a path with the filename).Name Description Commentsuserdata-qemu.img An image to which the emulator writes runtime user-data for a unique user. Override using -data , where is the path the image, relative to the current working directory. If you supply a filename only, the emulator looks for the file in the current working directory. If the file at does not exist, the emulator creates an image from the default userdata.img, stores it under the name you specified, and persists user data to it at shutdown.sdcard.img An image representing an SD card inserted into the emulated device. Override using -sdcard , where is the path the image, relative to the current working directory. If you supply a filename only, the emulator looks for the file in the current working directory.User-Data ImageEach emulator instance uses a writeable user-data image to store user- and session-specific data. For example, it uses the image to store a unique user‟s installed application data, settings, databases, and files.At startup, the emulator attempts to load a user-data image stored during a previous session. It looks for the file in the current working directory, in the AVD directory as described above, and at the custom location/name that you specified at startup.* If it finds a user-data image, it mounts the image and makes it available to the system for reading/writing of user data.* If it does not find one, it creates an image by copying the system user-data image (userdata.img), described above. At device power-off, the system persists the user data to the image, so that it will be available in the next session. Note that the emulator stores the new disk image at the location/name that you specify in -data startup option.Note: Because of the AVD configurations used in the emulator, each emulator instance now gets its own dedicated storage. There is no need to use the -d option to specify an instance-specific storage area.SD CardOptionally, you can create a writeable disk image that the emulator can use to simulate removeable storage in an actual device. For information about how to create an emulated SD card and load it in the emulator, see SD Card EmulationYou can also use the android tool to automatically create an SD Card image for you, when creating an AVD. For more information, see Command-line options for AVDs.Temporary ImagesThe emulator creates two writeable images at startup that it deletes at device power-off. The images are:* A writable copy of the Android system image* The /cache partition imageThe emulator does not permit renaming the temporary system image or persisting it at device power-off.The /cache partition image is initially empty, and is used by the browser to cache downloaded web pages and images. The emulator provides an -cache , which specifies the name of the file at which to persist the /cache image at device power-off. If does not exist, the emulator creates it as an empty file.You can also disable the use of the cache partition by specifying the -nocache option at startup.Emulator NetworkingThe emulator provides versatile networking capabilities that you can use to set up complex modeling and testingenvironments for your application. The sections below introduce the emulator‟s network architecture and capabilities.Network Address SpaceEach instance of the emulator runs behind a virtual router/firewall service that isolates it from your development machine‟s network interfaces and settin gs and from the internet. An emulated device can not see your development machine or other emulator instances on the network. Instead, it sees only that it is connected through Ethernet to a router/firewall.The virtual router for each instance manages the 10.0.2/24 network address space — all addresses managed by the router are in the form of 10.0.2., where is a number. Addresses within this space are pre-allocated by the emulator/router as follows:Network Address Description10.0.2.1 Router/gateway address10.0.2.2 Special alias to your host loopback interface (i.e., 127.0.0.1 on your development machine)10.0.2.3 First DNS server10.0.2.4 / 10.0.2.5 / 10.0.2.6 Optional second, third and fourth DNS server (if any)10.0.2.15 The emulated device‟s own netwo rk/ethernet interface127.0.0.1 The emulated device‟s own loopback interfaceNote that the same address assignments are used by all running emulator instances. That means that if you have two instances running concurrently on your machine, each will have its own router and, behind that, each will have an IP address of 10.0.2.15. The instances are isolated by a router and can not see each other on the same network. For information about how to let emulator instances communicate over TCP/UDP, see Connecting Emulator Instances.Also note that the address 127.0.0.1 on your development machine corresponds to the emulator‟s own loopback interface. If you want to access services running on your development machine‟s loopback interface (a.k.a. 127.0.0.1 on your machine), you should use the special address 10.0.2.2 instead.Finally, note that each emulated device‟s pre-allocated addresses are specific to the Android emulator and will probably be very different on real devices (which are also very likely to be NAT-ed, i.e., behind a router/firewall) Local Networking LimitationsEach emulator instance runs behind a virtual router, but unlike an actual device connected to a physical router, the emulated device doesn‟t have access to a physical network. Instead it runs as part of a normal application on your development machine. This means that it is subject to the same networking limitations as other applications on your machine:* Communication with the emulated device may be blocked by a firewall program running on your machine.* Communication with the emulated device may be blocked by another (physical) firewall/router to which your machine is connected.The emulator‟s virtual router should be able to handle all outbound TCP and UDP connections/messages on behalf of the emulated device, provided your development machine‟s network environment allows it to do so. There are no built-in limitations on port numbers or ranges except the one imposed by your host operating system and network.Depending on the environment, the emulator may not be able to support other protocols (such as ICMP, used for “ping”) might not be supported. Currently, the emulator does not support IGMP or multicast.Using Network RedirectionsTo communicate with an emulator instance behind its virtual router, you need to set up network redirections on the virtual router. Clients can then connect to a specified guest port on the router, while the router directs traffic to/from that port to the emulated device‟s host port.To set up the network redirections, you create a mapping of host and guest ports/addresses on the the emulator instance. There are two ways to set up network redirections: using emulator console commands and using the ADB tool, as described below.Setting up Redirections through the Emulator ConsoleEach emulator instance provides a control console the you can connect to, to issue commands that are specific to that instance. You can use the redir console command to set up redirections as needed for an emulator instance. First, determine the console port number for the target emulator instance. For example, the console port number for the first emulator instance launched is 5554. Next, connect to the console of the target emulator instance, specifying its console port number, as follows:telnet localhost 5554Once connected, use the redir command to work with redirections. To add a redirection, use:.add ::where is either tcp or udp, and and sets the mapping between your own machine and the emulated system,。
安卓虚拟机安装及使用教程

Google在香港发布了最新版安卓系统:安卓4.0,并且提供了Android SDK R14下载,让所有还不及升级Android4.0,没有安卓手机/安卓平板的电脑用户体验一下安卓的魅力(Android SDK本来主要用于Android开发者测试软件,Android SDK R14可以模拟Android1.5/1.6/2.0/2.1/2.2/2.3/2.4/2.0/3.1/3.2/4.0系统,支持所有分辨率,可在电脑上模拟手机运行所有安卓软件,安卓游戏,安卓网也经常用它也测试软件。
),今天安卓网在全球首发Android SDK R14,并为新手写这篇Android4.0模拟器下载安装使用教程。
教程一共分为两步,一是Android SDK(安装模拟器),二是模拟器成中文及安装各种软件游戏。
一、在电脑上下载安装Android模拟器1、由于Android模拟器需要在Java环境才能运行,先下载J ava安装吧。
(如已有Java环境的可跳过此步)Java环境下载32位系统用户下载:/otn-pub/java/jdk/7u1-b08/jdk-7u1-windows-i586.exe64位系统用户下载:/otn-pub/java/jdk/7u1-b08/jdk-7u1-windows-x64.exeLinux系统/苹果系统用户请到/technetwork/java/javase/downloads/jdk-7u1-download-513651.html下载。
提示:右键我的电脑,选择属性(win7用户右键我的计算机选择属性就可以看到电脑是32位还是64位的,xp几乎都是32位的)下载完成后安装即可。
2、下载安装Android SDK:安卓网Android4.0模拟器下载地址(含windows版和Linux版下载):/soft/1566.html,下载完成后,解压到某个目录。
如:D:\android-sdk_r14-windows(注意,目录不要有中文哦)3、配置Android模拟器运行SDK Manager.exe (在D:\android-sdk_r14-windows目录下)。
安卓模拟器怎么用
安卓模拟器怎么用标题:安卓模拟器怎么用导言:安卓模拟器是一种软件工具,可以在计算机上模拟运行安卓系统,使用户能够在电脑上体验和使用安卓应用程序。
在本文中,我们将向您介绍安卓模拟器的基本操作方法,以帮助您更好地使用。
1. 安装安卓模拟器首先,在您的计算机上下载并安装安卓模拟器软件。
目前市场上有许多种不同的模拟器可供选择,如BlueStacks、Nox、Andy等。
根据您的需求和计算机的配置选择一个适合的模拟器进行安装。
2. 启动模拟器安装完成后,双击模拟器的图标以启动软件。
在启动过程中,可能需要一些初始化的配置和设置。
请按照软件的提示进行操作,直到模拟器完全启动。
3. 下载安卓应用在成功启动模拟器后,您可以像在真实的安卓设备上一样,在模拟器中访问Google Play商店或其他应用商店,搜索并下载您喜欢的应用。
另外,您还可以从第三方网站或应用市场下载apk文件,然后在模拟器中进行安装。
4. 安装应用已下载完成的应用程序将显示在模拟器的应用列表中。
双击应用图标即可开始安装过程。
安装过程可能需要一些时间,请耐心等待。
一旦安装完成,您就可以在模拟器中使用该应用了。
5. 设置模拟器有些模拟器提供了一些配置选项,您可以根据自己的需求进行一些个性化设定。
例如,您可以设置模拟器的分辨率、虚拟硬件等参数,以获得更好的使用体验。
6. 与外部设备连接安卓模拟器通常支持与外部设备的连接,如键盘、鼠标、游戏手柄等。
您只需将这些设备通过USB接口连接至计算机,在模拟器中进行相应的设置即可开始使用。
7. 文件共享与传输模拟器通常会为用户提供一个文件管理器,允许您在计算机和模拟器之间共享和传输文件。
您可以通过拖放文件或使用特定的文件传输功能来完成文件的移动。
8. 快捷键操作为了方便用户的操作,安卓模拟器通常提供了一些快捷键。
这些快捷键可以使您更高效地使用模拟器。
您可以在模拟器的设置菜单中找到这些快捷键的相关信息。
9. 多开模拟器如果您有多个安卓模拟器,您可以同时运行它们,以便在不同的模拟器中登录不同的账号,或者在多个模拟器之间进行数据的互相传递。
使用Android模拟器
Android 4.0模拟器 介绍
在Android4中,模拟器将同时支持移动电话与平板电脑。下面以平板电脑为例 (使用WSVGA皮肤),介绍一下Android模拟器。
模拟器限制
在当前版本中,模拟器有如下限制: 不支持拨打或接听真实电话,但是可以使用模拟器控制台模拟电话呼叫。 不支持USB连接; 不支持相机/视频采集(输入); 不支持设备连接耳机; 不支持确定连接状态; 不支持确定电量水平和交流充电状态; 不支持确定SD卡插入/弹出; 不支持蓝牙。
模拟器概述
Android模拟器是一个基于QEMU的程序,它提供了可以运行பைடு நூலகம்ndroid应用的虚拟 ARM移动设备。它在内核级别运行一个完整的Android系统栈,其中包含了一组 可以在自定义应用中访问的预定义应用程序(例如拨号器)。开发人员通过定义 AVD来选择模拟器运行的Android系统版本,此外还可以自定义移动设备皮肤和 键盘映射。在启动和运行模拟器时,开发人员可以使用多种命令和选项来控制模 拟器行为。
如果需要停止模拟器,将模拟器窗口关闭即可。
控制模拟器
模拟器与磁盘镜像
模拟器使用电脑上可挂载的磁盘镜像来模拟真实设备的闪存分区。例如,它使用 包含模拟器专用内核的磁盘镜像、Android系统、ram磁盘镜像和保存用户数据和 模拟SD卡的可写镜像。 正常启动模拟器,需要用到一组特定的磁盘镜像文件。默认情况下,模拟器总是 在AVD使用的私有存储区域查找磁盘镜像。如果模拟器启动时没有找到镜像文件, 它会根据SDK中储存的默认版本在AVD文件夹中创建磁盘镜像。
设置模拟器语言
前面介绍了Android模拟器的配置及启动。在启动模拟器后,默认情况下使用的 是英语。为了方便不熟悉应用的用户使用,下面演示如何设置语言为简体中文。
精品IT教程Android模拟器安装及使用图文教程参考模板
Android 模拟器安装及使用图文教程你是否想测试下最新的 Google Android 操作系统,但又不想购买一款新的 Android 手机呢?本文将介绍如何在电脑上安装 Android SDK 模拟器,并运行 Android 系统。
Android 是风靡全球的最新的移动操作系统,但并不是所有人都有机会接触到最新的移动设备。
幸好,有一种比较简单的方式可能在Windows, Mac, 或者 Linux 电脑上运行 Android 系统。
Google 使用自己的 SDK 发布了一款 Android 模拟器以方便开发者在手机上运行之前先在模拟器上测试应用。
我们可以使用它在电脑上运行Android。
入门运行 Android 模拟器需要 Java 支持,因此电脑没有安装 Java 的话,请先点击文章末尾的链接下载并正常安装。
提示:安装 Java 的时候,注意不要安装价值的 Yahoo 工具栏。
然后,从 Google 下载电脑对应版本的 Android SDK (文末有链接)。
下载完成后解压。
Windows 操作系统下,双击 SDK Setup.exe 就可以开始在电脑上运行 Android 模拟器。
SDK 会从 Google 的服务器检查可更新的套件。
如果看到 SSL 错误信息,找到后台运行的“Android SDK and AVD Manager”窗口,并单击左侧的设置标签。
在这里,取消“Force https://… sources to be fetched using http://…”框,单击确定,然后重新打开安装程序。
此时将会安装一些包。
我们可以有选择性的安装一些包,然后点击“Insatll”按钮在电脑上安装 Android 模拟器。
默认情况下,所有的 SDK 平台,例程,APIs 都会被安装。
这可能需要相当长的时间来下载所有可用的 Android 版本。
如果仅仅是为了体验下 Android 的话,选择需要安装的版本即可。
Android模拟器Genymotion使用详解
Android模拟器Genymotion使⽤详解介绍Genymotion是⼀款出⾊的跨平台的Android模拟器,具有容易安装和使⽤、运⾏速度快的特点,是Android开发、测试等相关⼈员的必备⼯具。
官⽹地址:使⽤在Genymotion官⽹上注册⼀个账号地址:下载安装Genymotion地址:Windows选择 with VirtualBox的版本进⾏安装,安装过程⽐较简单,此处就不介绍了。
Ubuntu下载安装VirtualBox,地址:下载genymotion-2.12.0-linux_x64.bin,执⾏以下命令:chmod +x genymotion-2.12.0-linux_x64.bin./genymotion-2.12.0-linux_x64.bin进⼊genymotion⽬录,双击genymotion图标就可以启动Genymotion了设置Genymotion安装完成后,打开Genymotion,选择Settings,进⼊设置界⾯,选择Account,然后进⾏登录登录完成后的界⾯如下所⽰:选择ADB,选择Use custom Android SDK tools,设置Android SDK为本地SDK路径,如下:安装虚拟设备选择Add,弹出选择虚拟设备界⾯,选择对应的设备安装即可,如下:ps:依本⼈的经验,虚拟设备很难下载,经常出现⽆法下载的情况,我已经将⼀些虚拟设备对应的ova下载好,可以从我的百度⽹盘中下载,地址:Genymotion ova下载的url地址为:/dists/xxx/ova/xxxxxx,可复制下载地址到迅雷中下载,速度会快很多,其中xxx为虚拟设备对应的Android系统版本号,如4.2.2,7.0.0,xxxxxx为ova的⽂件名,如genymotion_vbox86p_6.0_200611_231536.ova完整的下载地址链接如下:下载链接地址前缀的规则如下:Android OS 版本下载地址前缀4.4/dists/4.4.4/ova/5.0/dists/5.0.0/ova/5.1/dists/5.1.0/ova/6.0/dists/6.0.0/ova/7.0/dists/7.0.0/ova/7.1/dists/7.1.0/ova/8.0/dists/8.0/ova/8.1/dists/8.1/ova/9.0/dists/9.0/ova/10.0/dists/10.0/ova/介绍⼀下如何使⽤ova⽂件,仔细看哦,同学们复制ovaWindows系统复制这些ova到C:\Users\xxx\AppData\Local\Genymobile\Genymotion\ova,Mac OS对应的⽬录为/User/xxx/.Genymobile/Genymotion/ova,Ubuntu对应的⽬录为/home/xxx/.Genymobile/Genymotion/ova,其中xxx为本地计算机的⽤户名,如果出现联机下载的情况,可能是Genymotion后台对应的ova⽂件名称改变了,下载的⽂件名可在C:\Users\xxx\AppData\Local\Genymobile\Genymotion\ova⽬录下查看导⼊本地的ova⽂件启动Genymotion,选择Add,在Select a new virtual device界⾯上选择模拟器名称,如:Samsung Galaxy S6 - 5.1.0 - API 22 - 1440x2560然后点击Next,会出现以下界⾯,等待⼀会,等虚拟设备创建完成,返回主界⾯,就可以看到Samsung Galaxy S6 - 5.1.0 - API 22 - 1440x2560已经添加到虚拟设备列表⾥了双击该项,就可以启动模拟器了,启动完成后的画⾯如下:虚拟设备对应表虚拟设备名称ova名称Samsung Galaxy Note 2 - 4.1.1 - API 16 - 720x1280genymotion_vbox86p_4.1_180130_193032.ov Sony Xperia Z - 4.2.2 - API 17 - 1080x1920genymotion_vbox86p_4.2_180130_203606.ovSony Xperia Z - 4.3 - API 18 - 1080x1920genymotion_vbox86p_4.3_180130_212946.ov Samsung Galaxy S5 - 4.4.4 - API 19 - 1080x1920genymotion_vbox86p_4.4_180130_224958.ovGoogle Nexus 5 - 5.0.0 - API 21 - 1080x1920genymotion_vbox86p_5.0_180215_000000.ovSamsung Galaxy S6 - 5.1.0 - API 22 - 1440x2560genymotion_vbox86p_5.1_180219_000000.ovSamsung Galaxy S6 - 6.0.0 - API 23 - 1440x2560genymotion_vbox86p_6.0_180219_000000.ovGoogle Nexus 6P - 7.0.0 - API 24 - 1440x2560genymotion_vbox86p_7.0_180216_000000.ovSamsung Galaxy S7 - 7.1.0 - API 25 - 1440x2560genymotion_vbox86p_7.1_180216_000000.ovSamsung Galaxy S8 - 8.0 - API 26 - 1440x2960genymotion_vbox86p_8.0_180223_000000.ov常见问题以下是本⼈在使⽤Genymotion的过程中遇到的问题及解决办法,不⼀定适⽤于所有情况,仅供参考。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
在讲新的知识前让我们一起学习一下模拟器的使用。
本节内容如下:
模拟器和真机的比较
创建Android模拟器(emulator)
运行Android模拟器
设置简体中文语言界面
模拟手机拨打电话和发送短信的功能
源代码:本讲没有代码
1.模拟器和真机的比较
1.android模拟器不具备的功能:
不支持呼叫和接听实际来电;但可以通过控制台模拟电话呼叫(呼入和呼
出)
不支持USB连接
不支持相机/视频捕捉
不支持音频输入(捕捉);但支持输出(重放)
不支持扩展耳机
不能确定连接状态
不能确定电池电量水平和交流充电状态
不能确定SD卡的插入/弹出
不支持蓝牙。
2.模拟器具备的独特功能:
api demo,这个API演示主要是ui部分,各种简单的控件使用技巧在里
面都可以找到,
dev tools,在dev tools可以获取到一些debug时需要的信息。
2.创建模拟器运行SDK目录中的sdk setup.exe文件,点击左侧Virtual Devices
选项卡,点击New…
在新弹出的窗口里填写:
name: 2.2_hvga (给虚拟机起个名字) Target: 2.2 选择版本
SD card:128MB 存储卡内存多少兆Skin:模拟器外观和屏幕尺寸Hardware:支持的硬件设备
创建模拟器的视频操作可以参见本博客的:第三讲视频,创建模拟器。
3.运行Android模拟器
命令行中运行Android模拟器的命令emulator.exe –avd 2.2_432
其中–avd 的意思是android virtual driver (安卓虚拟设备)
2.2_432 是模拟器的名字,2.2是版本号,432是设备分辨率
Android模拟器的启动速度很慢,大约需要2-3分钟,等待的时候不要担心有什么问题。
下面是启动成功的画面。
要注意的是用的模拟器不同,画面风格也会不同。
4.为模拟器设置简体中文界面
Home -> setting -> Language & keyboard ->select language
具体操作见第三讲视频文件:为Android模拟器设置简体中文界面。
设置成功后的界面如下:
5.模拟手机拨打电话和发送短信的功能
打电话和发短信需要至少2个模拟器。
注意模拟器标题上的数字“5554,5556,5558” 就是这个模拟器的电话号码。
具体操作可以看第三讲视频:用Android模拟器拨打电话和收发短信。