Xcode 看不到我的 iOS 设备,但 iTunes 可以
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10087985/
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
Xcode doesn't see my iOS device but iTunes does
提问by Vlad
I have a strange problem.
我有一个奇怪的问题。
I have an iPad with iOS 5.0.1 (9A405) and iOS SDK 5.0.1 with Xcode 4.2 (Build 4C199) installed on my Mac.
我的 Mac 上安装了装有 iOS 5.0.1 (9A405) 的 iPad 和装有 Xcode 4.2 (Build 4C199) 的 iOS SDK 5.0.1。
Xcode doesn't see my device. It says "iOS Device" not "Sauron's iPad" as usual.
(I am sure that device is connected because I see it in iTunes.)
Xcode denies to start my application on device.
It says:
Xcode 看不到我的设备。它像往常一样显示“iOS 设备”而不是“Sauron 的 iPad”。
(我确定该设备已连接,因为我在 iTunes 中看到它。)Xcode 拒绝在设备上启动我的应用程序。它说:
"Xcode cannot run using selected device. No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination."
“Xcode 无法使用选定的设备运行。没有配备兼容 iOS 版本的 iOS 设备可用。将 iOS 设备与足够新的 iOS 版本连接以运行您的应用程序或选择 iOS 模拟器作为目标。”
Xcode sees my other iPad with iOS 4.3.3 and can run applications on this device. I have tried to restart my Mac - without result.
Xcode 可以看到我的另一台装有 iOS 4.3.3 的 iPad,并且可以在该设备上运行应用程序。我试图重新启动我的 Mac - 没有结果。
I also checked provisioning profile, developer certificate, etc.
我还检查了供应曲线,开发者证书,等等。
Does anybody have ideas?
有人有想法吗?
采纳答案by iVipS
Select Window ? Organizer in Xcode. Now under Devices, select your device. If it is not ready for development then click use for development.
If above doesn't solve your problem then from your project settings, set deployment target to one which your app is developed for or lesser.
Otherwise there is some issue with certificates and provisioning profiles. Make sure your device's UDID is added in the provisioning profile you are using.
选择窗口?Xcode 中的组织者。现在在设备下,选择您的设备。如果没有准备好开发然后单击用于开发。
如果以上不能解决您的问题,那么从您的项目设置中,将部署目标设置为您的应用程序开发的目标或更低的目标。
否则,证书和配置文件存在一些问题。确保您的设备的 UDID 已添加到您正在使用的配置文件中。
回答by jcaron
Even though this one does not address the specific problem of the OP, it might be a solution for other people finding this question.
即使这个没有解决 OP 的具体问题,它也可能是其他人发现这个问题的解决方案。
In some circumstances, Xcode will not recognise (won't even see) a connected device that was previously recognised, even though there were no changes in Mac OS/iOS/Xcode versions. This seems to happen if you connect the device while the Mac and/or the device are locked when you connect them. The device will ask if you want to trust the computer even though you already did so, but the device will still not be visible in Xcode.
在某些情况下,即使 Mac OS/iOS/Xcode 版本没有变化,Xcode 也无法识别(甚至看不到)之前已识别的连接设备。如果在 Mac 和/或设备被锁定时连接设备,则似乎会发生这种情况。即使您已经这样做了,设备也会询问您是否要信任计算机,但该设备在 Xcode 中仍然不可见。
Restarting Xcode or the device do not seem to have any effect. One solution is to reboot the Mac. Another much quicker solution is to restart usbmuxd
:
重新启动 Xcode 或设备似乎没有任何效果。一种解决方案是重新启动 Mac。另一个更快的解决方案是重新启动usbmuxd
:
- Quit Xcode
- Disconnect the device
- In a terminal window, type:
sudo pkill usbmuxd
(it will be restarted again automatically) - Restart Xcode
- Connect the device
- 退出 Xcode
- 断开设备
- 在终端窗口中,键入:(
sudo pkill usbmuxd
它将自动重新启动) - 重启Xcode
- 连接设备
Your device should now be visible again in Xcode!
您的设备现在应该再次在 Xcode 中可见!
Hope that helps a few people. Apparently it does!
希望能帮到一些人。显然是的!
回答by Alex Pelletier
Had the same problem , restarted xcode and it found my phone again.
有同样的问题,重新启动 xcode,它又找到了我的手机。
回答by Jeremy_inPDX
I ran into this issue today where Xcode 8.2.1 suddenly decided the connected ipad (ios 10.2) was no longer connected. Unplugged, plugged back in, rebooted my macbook, and tried numerous recommendations above. The thing that fixed the issue for me was shutting down and rebooting the ipad device itself.
我就遇到了这个问题,今天的的Xcode 8.2.1突然决定所连接的iPad(IOS 10.2)不再相连。拔下,重新插入,重新启动我的 macbook,并尝试了上面的许多建议。 为我解决问题的是关闭并重新启动 ipad 设备本身。
回答by Kasper Munck
To others who might have the same issue and the answers above don't work: Make sure that the iOS version installed on your device matches the iOS SDK version you have installed on your mac. If these don't match you are unable to build to the device.
对于可能遇到相同问题但上述答案不起作用的其他人:请确保您设备上安装的 iOS 版本与您在 Mac 上安装的 iOS SDK 版本匹配。如果这些不匹配,您将无法构建到设备。
回答by Franck
I get this problem once, using a not official Apple cable.
我曾经遇到过这个问题,使用的是非官方 Apple 电缆。
Hope it helps.
希望能帮助到你。
回答by Alexandr Kolesnik
In my case I did next steps
就我而言,我做了下一步
- Quit XCode
- Disconnect device
- In your terminal
sudo launchctl stop com.apple.usbmuxd
- Relaunch Xcode
- Connect device
- 退出 XCode
- 断开设备
- 在你的终端
sudo launchctl stop com.apple.usbmuxd
- 重新启动Xcode
- 连接设备
回答by Abhishek Mishra
回答by Benjamin Oman
I just barely tried every solution suggested above. The only thing that worked and resolved my issue was to go into xcode's "Organizer", right click on my iPhone, click on "Remove from organizer" and then wait about 10 seconds while xcode automatically re-added the device.
我几乎没有尝试过上面建议的所有解决方案。唯一有效并解决我的问题的方法是进入 xcode 的“管理器”,右键单击我的 iPhone,单击“从管理器中删除”,然后等待大约 10 秒钟,同时 xcode 自动重新添加设备。
I previously plugged in my phone and itunes recognized it fine and synced with it, etc, but all xcode said in the organizer was "Device is not currently connected", which it was most definitely connected if itunes was syncing with it and not syncing over wi-fi.
我以前插入我的手机,itunes 可以很好地识别它并与之同步,等等,但是组织者中的所有 xcode 都是“设备当前未连接”,如果 itunes 正在与它同步而不是同步,它肯定是已连接的无线上网。
Why xcode needed me to delete and re-add the phone is beyond me, but it works great now that I did this.
为什么 xcode 需要我删除和重新添加电话是我无法理解的,但现在我这样做了,效果很好。
回答by Michael
I tried all of the above to no avail. I had been using the phone for ages and suddenly the Organizer thought "this device is currently not connected". A reset of the phone fixed it for me (hold Home & Power until the Apple logo). I did so with it still connected to the MacBook, but it shouldn't be necessary.
我尝试了以上所有方法都无济于事。我一直在使用手机,突然组织者认为“此设备当前未连接”。重置手机为我修复了它(按住 Home & Power 直到出现 Apple 标志)。我这样做是在它仍然连接到 MacBook 的情况下进行的,但这不是必需的。