xcode 尝试与此设备通信时遇到错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45587463/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:10:37  来源:igfitidea点击:

An error was encountered while attempting to communicate with this device

iosxcodeios11xcode9

提问by mgyky

I get this error while "Connect via network" option in new version of XCode9 and iOS11.

在新版本的 XCode9 和 iOS11 中使用“通过网络连接”选项时出现此错误。

enter image description here

在此处输入图片说明

I checked the "Connect via network" box. After few seconds XCode gives me this error:

我选中了“通过网络连接”框。几秒钟后,XCode 给了我这个错误:

"An error was encountered while attempting to communicate with this device"

“尝试与此设备通信时遇到错误”

Anyone facing the same issue?

有人面临同样的问题吗?

current configuration

当前配置

  • XCode Version 9.0 beta 5 (9M202q)
  • iOS Beta 5
  • iPad Air
  • XCode 9.0 测试版 5 (9M202q)
  • iOS 测试版 5
  • iPad Air

回答by mgyky

I found that error causes when device lost connection for a moment. it's happen when you have damaged (or very old) cable. How ironic... trying to connect a device for ones for been wireless anymore, but cable...

我发现该错误导致设备暂时失去连接。当您损坏(或非常旧)的电缆时会发生这种情况。多么具有讽刺意味......试图连接一个设备,因为它不再是无线的,但是电缆......

回答by Anil Prasad

I got same error in my case Quit Xcode after that restart clean and build its working fine .

在我的情况下,我遇到了同样的错误,重启干净后退出 Xcode 并构建其工作正常。

回答by Ethan Brimhall

All I did was unplug the charger from the phone and replugged it back in. This solved it for me.

我所做的就是从手机上拔下充电器并重新插入。这为我解决了这个问题。

回答by WholeCheese

There might be more than one reason for this error:

导致此错误的原因可能不止一个:

"An error was encountered while attempting to communicate with this device. (The service is invalid.)"

“尝试与此设备通信时遇到错误。(服务无效。)”

I hit this problem today after I transferred my iPad XCode project from one Mac to another. I was pretty sure there was nothing wrong with my USB cable, it was working just fine on the other Mac with the same iPad.

在我将 iPad XCode 项目从一台 Mac 转移到另一台后,我今天遇到了这个问题。我很确定我的 USB 电缆没有任何问题,它在使用相同 iPad 的另一台 Mac 上运行良好。

So I did the old XCode standby voodoo solution:

所以我做了旧的 XCode 备用 voodoo 解决方案:

  1. in XCode, do a Product->Clean Build Folder;
  2. quit XCode;
  3. from the macOS Finder, delete the DerivedDatafolder for the project;
  4. launch XCode, rebuild and run.
  1. 在 XCode 中,做一个Product->Clean Build Folder;
  2. 退出 XCode;
  3. 从 macOS Finder 中,删除DerivedData项目的文件夹;
  4. 启动 XCode,重建并运行。

It works just fine now.

它现在工作得很好。