iOS 设备不会出现在 Xcode 6.1.1 上 - 直到重新启动 Mac

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27613083/
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 06:24:27  来源:igfitidea点击:

iOS Devices do not show up on Xcode 6.1.1 - until after rebooting the Mac

iosiphonexcodeipadosx-yosemite

提问by timmitra

Since updating to Xcode 6.1 all of my iOS devices will not be recognized by the Mac after a period of time. It used to be every couple of days, but now it is happening several times a day.

由于更新到 Xcode 6.1,一段时间后 Mac 将无法识别我的所有 iOS 设备。以前每两天一次,但现在每天发生几次。

The only remedy is to reboot the Mac. This is completely unacceptable and counter to any UNIX based OS. I have run this same Mac for months before installing Yosemite, without issue.

唯一的补救措施是重新启动 Mac。这是完全不可接受的,并且与任何基于 UNIX 的操作系统背道而驰。在安装 Yosemite 之前,我已经运行这台 Mac 几个月了,没有问题。

The only clue is in the System logs:

唯一的线索是在系统日志中:

12/22/14 8:42:53.681 PM Xcode[385]: AMDeviceConnect (thread 0x128e11000): Could not connect to lockdown port (62078) on device 67 - 28cb21671799bc4efe266987ae586ba2cb6247b7: 0xe8000084.

I have scoured the web for weeks and even filed a radar. I know that other devs have experienced this ridiculous behavior. Does anyone have a idea what is going on or what service is failing?

我已经在网上搜索了数周,甚至提交了雷达。我知道其他开发人员也经历过这种荒谬的行为。有谁知道发生了什么或什么服务失败了?

Currently running OS X 10.10.1, Xcode 6.1.1 and issues occur with iOS 8.1.2, iOS 8.1 and iOS 7.1.2

当前运行 OS X 10.10.1、Xcode 6.1.1,iOS 8.1.2、iOS 8.1 和 iOS 7.1.2 出现问题

回答by mahboudz

I've been having this issue for over a month now. It's not just Xcode but also iTunes, Image Capture, and some other apps that should easily see my devices. I also often get the "trust this computer?" query, but not every time that the Mac starts rejecting my devices.

我已经有这个问题一个多月了。不仅仅是 Xcode,还有 iTunes、Image Capture 和其他一些应该可以轻松查看我的设备的应用程序。我也经常得到“信任这台电脑吗?” 查询,但不是每次 Mac 开始拒绝我的设备时。

Instead of restarting the Mac, the other option is to quit Xcode, issue the following command in Terminal:

另一个选择是退出 Xcode,而不是重新启动 Mac,在终端中发出以下命令:

sudo launchctl stop com.apple.usbmuxd

须藤launchctl停止com.apple.usbmuxd

and then restart Xcode

然后重新启动Xcode

回答by FormigaNinja

I don't know why this bug happens, but after searching a lot about it I got a simple but effective solution.

我不知道为什么会发生这个错误,但是在搜索了很多之后我得到了一个简单但有效的解决方案。

When the problem starts, I tried to restart my machine, re-install Xcode and Command Line tools without results, and after googling about it, I saw that you can fix it removing lockdownfolder using the command below and restarting.

当问题开始时,我尝试重新启动我的机器,重新安装 Xcode 和命令行工具没有结果,在谷歌搜索之后,我看到您可以lockdown使用以下命令修复它删除文件夹并重新启动。

sudo rm -rf /var/db/lockdown
sudo mkdir /var/db/lockdown
sudo chmod go+w /var/db/lockdown

It works for some users so I will leave it here, but in my case it not helped.

它适用于某些用户,所以我将把它留在这里,但在我的情况下它没有帮助。

As @mahboudz said, you can trigger the command below from terminal with Xcode closed, without restarting the machine.

正如@mahboudz 所说,您可以在关闭 Xcode 的情况下从终端触发以下命令,而无需重新启动机器。

sudo launchctl stop com.apple.usbmuxd

This time, my problem was gone, until I turn my Mac next day. The problem came back again. I can resolve it again temporary using the command above, but it will happen again and again on every launch.

这一次,我的问题消失了,直到第二天我打开我的 Mac。问题又来了。我可以使用上面的命令再次临时解决它,但它会在每次启动时一次又一次地发生。

Knowing the problem is related with com.apple.usbmuxd, I saw on some threads that this process is not only related with Xcode, but USB <-> iPhone device communication.

知道问题与com.apple.usbmuxd,我在一些线程上看到这个过程不仅与Xcode有关,而且与USB <-> iPhone设备通信有关。

I fix my problem definitely simply downloading and installing iTunes againafter stopping com.apple.usbmuxdprocess.

我解决了我的问题,只需在停止进程后再次下载和安装 iTunescom.apple.usbmuxd

回答by jay492355

In Xcode 6.3 with my iPad, I've found that rebooting the iPad works without having to close Xcode.

在带有 iPad 的 Xcode 6.3 中,我发现无需关闭 Xcode 即可重新启动 iPad。

回答by Daxesh Nagar

Top to your Right Click on
Window > Devices

在您的右上方单击“
窗口”>“设备”

You will see that no devices will be showing Do the following
Bottom Left
Click on the +
And then start adding your devices.

您将看到不会显示任何设备 执行以下
左下角
单击 +
然后开始添加您的设备。