android调试更换模拟器,在模拟器上调试 Android 磨损

在模拟器上调试 Android 磨损Debug Android Wear on an Emulator

06/21/2018

本文内容

这些文章介绍了如何在模拟器上调试 Xamarin 应用程序应用程序。These articles explain how to debug a Xamarin.Android Wear application on an emulator.

调试仿真程序的磨损概述Debug Wear on Emulator Overview

开发 Android 应用程序需要在物理硬件上运行应用程序,或者在使用模拟器或模拟器的情况下运行应用程序。Developing Android Wear applications requires running the application, either on physical hardware or using an emulator or simulator. 使用硬件是最好的方法,但并不总是最实用的方法。Using hardware is the best approach, but not always the most practical. 在许多情况下,如下面所述,使用模拟器来模拟/模拟 Android 磨损硬件可以更简单、更经济高效。In many cases, it can be simpler and more cost effective to simulate/emulate Android Wear hardware using an emulator as described below. 如果你尚不熟悉部署和运行 Android 应用程序的过程,请参阅Hello,磨损。If you are not yet familiar with the process of deploying and running Android Wear apps, see Hello, Wear.

配置 Android EmulatorConfigure the Android Emulator

若要在仿真程序上运行应用程序,必须安装 Android SDK Android Emulator 并对其进行配置以进行 Android 磨损。To run your Wear app on an emulator, you must install the Android SDK Android Emulator and configure it for Android Wear. 有关 Android SDK 模拟器的总体安装和配置信息,请参阅Android Emulator 安装程序。For overall Android SDK Emulator installation and configuration information, see Android Emulator Setup.

创建磨损虚拟设备时,请选择 Android 磨损设备配置文件(例如Android 磨损方形)。When you create a Wear virtual device, select an Android Wear device profile (such as Android Wear Square). 为了提高性能,请使用以下示例中所示的磨损x86 CPU/ABI:For improved performance, use the Wear x86 CPU/ABI as seen in this example:

81fcca9c08e36430b9be8ec50467bfa1.png81fcca9c08e36430b9be8ec50467bfa1.png

启动磨损虚拟设备Launch The Wear Virtual Device

创建 Android 磨损虚拟设备后,你可以在开始调试之前从 IDE 中的 "设备" 下拉菜单中选择它。After you have created an Android Wear virtual device, you can choose it from the device pull-down menu in the IDE before you start debugging. 如果设备下拉菜单中的虚拟设备不可用,请验证你的项目是否为 Android 应用程序项目(不是 Android应用程序项目)以及其目标 api 级别是否设置为与虚拟设备相同的 api 级别。If your virtual device is not available in the device pull-down, verify that your project is an Android Wear app project (not an Android app project) and that its target API level is set to the same API level as the virtual device. 例如:For example:

cd78419cefe3460007af721dd4760991.pngcd78419cefe3460007af721dd4760991.png

Android 仿真程序启动后,Xamarin 会将此应用程序部署到模拟器。After the Android emulator starts, Xamarin.Android will deploy the Wear app to the emulator. 仿真器会使用配置的虚拟设备映像运行此应用。The emulator runs the app with the configured virtual device image.

如果你首先看到此(或另一个插播式屏幕),请不要惊讶。Don't be surprised if you see this (or another interstitial screen) at first. 监视模拟器可能需要一段时间才能启动:The watch emulator can take a while to start up:

1ef2cae7661e02a82befc2d849816bd9.png

可以一直运行仿真器;无需关闭仿真器并在每次运行应用时重启。The emulator may be left running; it is not necessary to shut it down and restart it each time the app is run.

总结Summary

本指南介绍了如何配置用于磨损开发的 Android Emulator,并启动了用于调试的磨损虚拟设备。This guide explained how to configure the Android Emulator for Wear development and launch a Wear virtual device for debugging.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值