【问题标题】:Cannot debug Xamarin Android application in VS with ADB无法使用 ADB 在 VS 中调试 Xamarin Android 应用程序
【发布时间】:2016-10-10 00:44:59
【问题描述】:

我正在尝试在 Visual Studio 中运行示例 TipCalc Xamarin (Android) 应用程序,但是在它编译并运行 Android 模拟器后,我被告知:

adb 服务器版本 (32) 与此客户端 (36) 不匹配

我该如何解决这个问题?我已经更新了 Xamarin 和 Android SDK 文件,并且 Xamarin 正确指向我的 android SDK 位置 (D:\dev\Xamarin\AndroidSDK)。

这是我的 Android SDK 管理器的截图:

这是输出的更大的 sn-p:

1>D:\dev\Xamarin\AndroidSDK\platform-tools\adb.exe -s 169.254.138.177:5555 devices 
1>error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
1>List of devices attached
1>adb server version (32) doesn't match this client (36); killing...
1>could not read ok from ADB Server
1>* failed to start daemon *
1>error: cannot connect to daemon
1>
1>Selected device is not running.
1>Build FAILED.

更新:安装 Android SDK Build-tools 24.0.3(并删除 23.0.2)没有帮助。


this question 提供的这个答案没有帮助,因为我不知道 Appium 或 Genymotion 是什么,我也不使用 PHP。我同意虽然它们都是由 android 调试器引起的,但我需要 Xamarin 修复。

【问题讨论】:

标签: c# android xamarin visual-studio-2015 xamarin.android


【解决方案1】:

问题是您有另一个 adb 服务器同时运行。当您安装 Android SDK 时,它会安装 Xamarin 将使用的 adb 版本(在本例中为 36 版),但其他一些工具也安装了 adb。一些例子包括已经提到的 Gennymotion 和 Appium,在我的例子中,它是 Mobizen 的一部分,我用它来将 android 设备屏幕共享回我的 Mac。您将安装一些运行 adb(版本 32)的东西,从而导致冲突。

您需要做的是找到有问题的 adb install 并将其删除。我假设您在 Windows 上,所以最好启动任务管理器并查看查找 adb 的进程。一旦你找到它,你应该能够根据它的路径从它的属性中看到它安装了什么应用程序,这样你就可以卸载它或删除它。

【讨论】:

  • 我用的是HiSuite,华为的安卓设备管理软件。有时在我插入手机时它会启动它自己的 adb,但并非所有情况,所以有点难以找到,我刚插入手机时正在查看进程列表,并寻找新的 adb 实例 - gotcha !感谢您的帮助!
猜你喜欢
  • 1970-01-01
  • 2015-07-31
  • 2017-12-05
  • 2023-03-17
  • 2016-04-20
  • 1970-01-01
  • 2010-10-13
  • 2016-09-17
  • 1970-01-01
相关资源
最近更新 更多