android emulator培训,Android Emulator 2.0

CGDqA9mQOo8XfSrOwx-DaYC41w843WLDXbS_jN9Fp96JNU1NeukNUCZ5qm3tZNnvn8J08bv0gzpP3p0gAIP4c2tZUCa8U2S5Ef_hpkbIwUjgn4uksrg7iQcZZH0atsu1AkExcjSZ

The Android Studio 2.0 (or higher) preview includes the new Android Emulator 2.0 with improved performance and a new user interface to control device features. This page describes some of the changes compared to the emulator available with the stable version of Android Studio 1.5 and how to setup your development environment to use the Android Emulator.

For best performance with Android Emulator 2.0, your system should meet the following specifications:Windows: Intel® processor with support for Intel® VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit functionality. AMD and Intel Atom processors do not support VT-x virtual machine acceleration.

Linux: Intel® processor with support for Intel® VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit functionality or AMD processors with support for AMD Virtualization™ (AMD-V™)

64-bit Operating Systems.

New Features

The most valuable updates to the Android Emulator are the speed improvements. When running with Android Studio 2.0 or higher on an x86 machine, response time is faster than the previous Android Emulator and you can transfer files from your machine faster than a physical Android device.

The latest Android Emulator supports new multi-finger touch inputs, including pinch zoom and two finger rotate gestures. Holding down Alt or Option reveals two finger points. Moving the mouse moves one finger and the second finger is mirrored across an anchor point. Clicking the left mouse button enables pinch-zoom gestures and clicking the right mouse button enables two-finger rotate gestures (such as to tilt the perspective when viewing a map).

The panel on the right side of the emulator lets you perform common tasks, such as rotate the screen, capture screenshots, and zoom in on the display.

To install apps, you can drag and drop an APK right on the emulator. You can also drag and drop other file types and they'll be saved to the /sdcard/Download/ directory.

At the bottom of the toolbar on the right is an ellipsis button that opens the Extended Controls window. In here you'll find various controls that invoke device events and mock device sensors.

4_PmxGbFrOUd3cWYNVxoFsUWjmQCfdFQoM5kZOUzqByzTpGCYVSUgsRwbS4ILbb_hqeWCffPBhYGEClU068tUFTykUvLkvfTbv4z2YakTZnmhc52dWVg6liyw-CZ0LivucaISCVh

Keyboard shortcuts are available for most actions and are listed in the Help panel, listed on the left.

Get Android Emulator 2.0

The new Android Emulator is available with Android Studio 2.0 or higher, which is available in both theStable, Beta and Canary channels.

Once you  make sure you have the appropriate emulator system image and other tools:Open theSDK Managerfrom Android Studio.26USZvtLSUO7J9rBCCpoivGqrIGdYylaIjT62VjImSITUVY8rIiaJdNP4nz_YyEnTM_RN2Y4ustfVyrggAZcBEr6XzKEdGDkaFq9FQlI8uEk0KYD7mpLinFOvi-vsRlrjuBQxP6j

Click theSDK Platformstab, and select the check box for a recent version such as theAndroid 6.0 (Marshmallow). By default, this includes the x86 system image that you need for the emulator. You can see and modify the files to download by clickingShow Package Detailsat the bottom-right.

Click theSDK Toolstab, then select the check boxes for the following:Android SDK Tools (25.0.0 or higher to get the new emulator)

Android SDK Platform-Tools(23.1.0 or higher to get the fast ADB)

Intel x86 Emulator Accelerator (HAXM installer)(rev 6.0.1 or higher to get CPU acceleration)

ClickOKto check for updates.

FMvYJGzLPvgQ0hRqk1wMfdPahbBCXSIXUygqfdjUkx1q7J5OsOuqwm5ukhMrZvjgox9PCH3d9ybgxC12b24GYKVcPaHNybEzlnYtpgfSPs9qXf_DrS9de4oT7-2yIvCkUH4vgvQa

Create new Android Virtual Device (AVD)

To take advantage of the new Android Emulator and adb speeds, you need to create new AVDs. In this example below, we are creating a Nexus 5x AVD.

Open theAVD Managerfrom Android Studio.W13hLerjLrfrxyQMr9w6wMZWYJqGpiHyNn9oWlJrKjJBmwGcInSp9ofesLnNX-3gSVC7xcHRHCzaLC7WEhoheF5vfJpsY6XBpYlDUXPrThd1Dq_-CbgLytXv5c4bDYaiyF8UgZIH

ClickCreate Virtual Device.vU5-AuDhXRE1tugYgP5VP6ytBZ9fKdbLXpeb3FQMKZ-C89uOgG6rLVjP79MQ0g5WX91-SQsuuvkgpXHnURk5MIJwfDHlO8GW1Ya6uhmChu7nD3C9X2v8Nxuz4CHZanpu62-FIQ7Q

Select the defaults forNexus 5x.-NmsmjB02NZU2rjH8EbmHbHFeH5DdfddsXdi-bSNOVx5AoLgpG2QKBQgwTg5hgOdVioQkuk3gBtU3G4MmomATB6wNZwoxfN2cWsRTexJLDiKaSAbeKQ23qivub9ggZGzyTOrwvaK

Select a system image, such asMarshmallow - API 23 - x86.h_qybqmgQUPOSb_aK8WeskGql1EibsWa-HKV29PibbrgIiETlk7893dHi_rtq7B4tRqbAK9E77Sp9FlTIDxlDFhCcnfXDa5OD0BpRf-q2HWcmwm4UyKlE3pzxhK_pypoe6fphzde

SelectShow Advanced Settings.PJasN68FuSxwW-7c2ryzkCcP31a04Nagfxus-Myj6BEG-2qTFJCgTvEZMgVNpiVaPvIMy_4eEzVJ6oW8JQU6lCjgXrNZWZzNwWJ0gzOp-rtY-DIThdXuDzwkPEWSUUiHwFvme_83

Select the Multi-Core CPU check box. The number of cores available depends on the number of cores available on your development machine.-uhQVHo6k5ErvAo8q1i-vc7YIdRRJFJWgtTT0O0s_IZ9z4dyKqXCzkxenhXBRxQY1_JrFn1IvMi6Xr4jFwp-7g1TTyoUXQTp0TqGz7pGRelH0Z2nR9cw8F2hl1ryCVMoBjXXWc3d

Run your new Android Virtual Device by click on the greenPlaybutton.sqxNxlR59mHNscMYWV-ktvE9jVXybIDQ0boY40DllFsV0icc37hPkbjPuTE4YYB90o5xi4Apil-vAdOxC2wMdcKwjTpLcrPANj_HofhG5w4S712gnImaDNOSmW1ssMXFZP5jCYsD

You should see the Android Emulator now start up.

Troubleshooting

Check Intel x86 Emulator Accelerator Installation

If you selected the defaults during the Android Studio installation you should be ready to go. If you created a custom Android Studio installation or run into issues, read the troubleshooting guide below.  If your Intel x86 Emulator Accelerator is out of date, Android Studio will automatically inform you and suggest a quick fix to update, as shown in the following screenshot in the AVD Manager.

Xf5fZeYvShqSecOR05-a7laeWnhhIe_3RASIXGjXBBKapYcyB0pLBe7bd-rqTP6BwRmLPZBxJsQ1JLeqWXZX9Aa0NgZeMfwmyWdK1GSf6ChVFnHyVwjqMMckIS7By163bTSmOFPI

Installing CPU Accelerator (HAXM)

If you skipped the initial setup of Android Studio, you should make sure the CPU acceleration is installed.

You can manually install Intel x86 Emulator Accelerator by openingintelhaxm-android.exe(on Windows) orintelHAXM_6.0.1.dmg(on Mac) from/sdk/extras/intel/Hardware_Accelerated_Execution_Mangager, as shown below:

u6PYMA3b-bTzTRfNnR-CMl6_4MKZI81aXf03U7ogqZdVXGCpcHIhr2cGO0pZV_8ICwaVI7c3mgxezctVfGiRaUTZQKScLHG6T5GI3Qqk2CNQEqY5CT2rDRA2e74p-Mk5jUlfSX3w

Installing HAXM in Windows

5FX2_OtPDZvAwjv7Bb922t1fbQKLs5MUc-QmJYmfIdXpY29uChfb9ZofzLq0w4m0eXWS9A1Dqq9ofcrmKNuINR3q4nsxgL4yxkbJLYk0KSj3D4vuHvKtCIO_AHof90IJb2zDZkhe

Installing HAXM in OS X

For Linux, the Android emulator usesKernel-based Virtual Machine(KVM). If you are using Ubuntu, you can run check your KVM system compatibility by running the following on the command line:

$egrep –c '(vmx|svm)' /proc/cpuinfo

on the command line to check for for a return value of greater than 1

To check if you have KVM installed by running the following on the command line:

$kvm-ok

If KVM is missing or to ensure you have the latest KVM installed, run the following on the command line:

$sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils ia32-libs-multiarch

The linux commands look like the following on Ubuntu:

uZmBgvkAWEy9wfPJlVIBmtw-xT5lcUqu3dFBW3afi2gGT4ljuv77CONC7PqhKhjgGiJ0u955CwTf25T09FEYrlQYiZTSLg8tvKyUPwEGER_FgePf9duL40QrGXJiWEyaqDRMvUko

Known IssuesEmulating inbound phone call freezes emulator.

Screenshot feature crashes emulator in certain conditions.

If an AVD has been opened in a previous version of the emulator, it may not boot in the new emulator, therefore create a new AVD.

OSX - screen doesn't go black when you sleep the device.

Linux - segfault on exit in some conditions.

"-gpu mesa" option not supported.

"-net*" option not supported.

"-no-window" option not supported.

Remote desktop not supported.

Emulated hardware "recents" key doesn't work in older system images.

Multiple DNS servers not supported.

If you find other issues in the Android Emulator, pleasefile a bug report.

We have more features in the pipeline, but if you may alsosubmit feature requests.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值