Android 可穿戴模拟器无法与 USB 连接的手机连接 [英] Android wearable emulator can't connect with usb connected phone

查看:45
本文介绍了Android 可穿戴模拟器无法与 USB 连接的手机连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开发一个 android 可穿戴应用程序,但我没有可穿戴设备.所以我使用的是 Android 可穿戴模拟器.我尝试连接可穿戴模拟器和手机.手机用 USB 线连接.我的手机 API 版本是 19.可穿戴模拟器版本 20.我安装了 Android Wear 应用程序.我试图通过 ADB 命令连接模拟器和设备.我不确定蓝牙是否需要在移动设备中打开,因为我认为 USB 电缆可以连接到可穿戴模拟器.

I'm trying to develop an android wearable application but I don't have wearable device. So I'm using an Android wearable emulator. I tried to connect with wearable emulator and phone. Phone connected with usb cable. My phone API version is 19. Wearable emulator version 20. I installed Android Wear application in my phone. I tried to connect emulator and device by ADB command. I'm not sure bluetooth need to open in mobile device because i think usb cable can connect to wearable emulator.

检查设备列表

adb devices

结果

C:\Program Files (x86)\Android\android-studio\sdk\platform-tools>adb devices
连接的设备列表
HT365W906209 器件
模拟器-5554 设备

C:\Program Files (x86)\Android\android-studio\sdk\platform-tools>adb devices
List of devices attached
HT365W906209 device
emulator-5554 device

AVD 到手机的通讯端口

adb -d forward tcp:5601 tcp:5601

结果

C:\Program Files (x86)\Android\android-studio\sdk\platform-tools>adb -d forward tcp:5601 tcp:5601C:\Program Files (x86)\Android\android-studio\sdk\platform-tools>

C:\Program Files (x86)\Android\android-studio\sdk\platform-tools>adb -d forward tcp:5601 tcp:5601 C:\Program Files (x86)\Android\android-studio\sdk\platform-tools>

执行上述命令后,我无法连接我的设备和模拟器.我关注了 这个 教程.

After executing the above command, I can't connect with my device and emulator. I followed this tutorial.

这是我手机中的 Android Wear 应用.

推荐答案

您和本教程都没有提到您在 Android Wear Companion 应用中明确选择了 Pair with emulator.所以请尝试一下:

You, and the tutorial as well, haven't mentioned that you explicity selected Pair with emulator right inside the Android Wear Companion app. So please give this a try:

之后 ActionBar 应显示模拟器 - 正在连接...".再次执行 adb forward 命令,它应该工作.

Afterwards the ActionBar should say "Emulator - Connecting...". Execute the adb forward comand once again and it should work.

这篇关于Android 可穿戴模拟器无法与 USB 连接的手机连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆