ChatGPT解决这个技术问题 Extra ChatGPT

Xcode doesn't see my iOS device but iTunes does

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.

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 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 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.

I also checked provisioning profile, developer certificate, etc.

Does anybody have ideas?

Have you actually expanding the list? I get this thing after connecting someone other's device and then mine back. I have to explicitly expand the list and select my device. And yes, there is "iOS Device" option present!
Yes. I tried to expand device list. My device is absent.
Restarting the iPhone solved it for me.

j
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.

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.

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:

Quit Xcode Disconnect the device In a terminal window, type: sudo pkill usbmuxd (it will be restarted again automatically) Restart Xcode Connect the device

Your device should now be visible again in Xcode!

Hope that helps a few people. Apparently it does!


This also worked for me. I had a situation where iTunes also wasn't recognizing the device, and plugging the device back in resulted in the "Trust this Computer?" dialog each time.
Thank you!! This also fixed the "trust this computer" pop-up I was getting every time.
does this issue happen with somebody (Xcode 7.2 and iOS 9.2.1 device)? ( it happens with me and this method ( variations of this answer' steps help )
I actually haven't had it happen to me in a while, but it may be because I haven't done things like connecting a device while the Mac is locked. Or maybe it's because they fixed the issue.
This work - note: it happend because I deleted the mobileprovision profile file by mistake - so I had to added to organizer first.
D
Dovydas Šopa

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.


I Am Ashamed. I just forget to press "Use for development" in the XCode organizer.
@iVips - I am facing the similar problem but I am not even getting "Use for development", how to fix this?
I finally got Xcode to recognize my iPad using the instructions above and with the same config as @Dustin -- Xcode 5.0.2, iOS 7.0.4 -- on a Macbook Air running OSX 10.9.1. It took a fair amount of trial and error, however, and it wasn't until I finally disconnected to the iPad from the USB3 port on the left side of the computer and reconnected it to the USB3 port on the right side that Xcode finally recognized it.
in Xcode 7.3.1 there is no "Devices" option in the Organizer anymore. Any other ideas?
@kramer65, it is now Window > Devices instead of Window > Organizer > Devices
A
Alex Pelletier

Had the same problem , restarted xcode and it found my phone again.


If you have this alert message: "The run destination iPhone is not valid for Running the scheme 'video'." Follow this answer. It fixed the problem.
J
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.


After numerous attempts of trying to get Xcode on a virtualized Mac find my physically attached iPhone again, this tipp also worked for me: Simply rebooting the iPhone. Who said that "Did you try turning it off and on again?" only works for Windows? :) Thanks Jeremy!
Tried every other solution but this is the one that workedd for me. Xcode 10.1/ iphone 6s 12.4.1
n
neowinston

I get this problem once, using a not official Apple cable.

Hope it helps.


The same. In my case the problem was the cable too. I do not know why, but when I plugged in the phone it was charging, and I also saw it with the ioreg -p IOUSB command, and the phone showed me the message "Do you trust this computer?" But I could not see the device in the Xcode in any way. I tried another cable and it worked.
Same my case, its was cable issue.
K
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.


A
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


This works for me without relaunching xcode or device
nice, it saves me a lot of time
A
Abhishek Mishra

https://i.stack.imgur.com/Pw9C5.png


B
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.

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.

Why xcode needed me to delete and re-add the phone is beyond me, but it works great now that I did this.


M
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.


Thanks Michael - same problem. 5s working fine until xcode suddenly decided it wasn't there. Then iTunes agreed with xcode. Rebooting the phone fixed it for now. Getting worrying how many of these random bugs are getting past apple's release teams.
S
Sanoop Surendran

For Xcode 7 (and possibly above),

go to Window -> Devices, 

hit the plus sign at the bottom and select the device connected and hit next, then Use for development.

This only works if Xcode is reading your device, but you aren't able to run your app on the device.

Also make sure the device's OS version is greater than or equal to your app's Deployment Target OS version.


A
Arin

If none of these work, try simpling restarting your iphone or device! Works every time for me (:


Thanks bro, I thought I have to purchase a new one.
K
Kibernetik

Xcode did not see my iPad, iTunes also did not see my device. Rebooting Mac corrected the situation.


same issue happend in xcode 13 and this worked
K
Kirow

Had same problem with some non-licensed cables. Works fine with Apple's & Belkin's USB cables.


p
pcnick13

My app worked on all simulators but not on my device. I tried just about all the steps from each comment and didn't have any luck. I went to my device settings and switched my "Personal Hotspot" from off to on. Then it was all good!


For virtualbox Mac Catalina also it worked. Thanks mate.
1
1nstinct

https://i.stack.imgur.com/xkevR.png


O
Oras

Have you tried to delete and re install the device in your Apple Developer portal? If yes, try to upgrade your xcode to 4.3.2, I remember that I needed to update to xCode 4.3.2 after updating my iPhone to iOS 5.1


s
superarts.org

After updating my iPhone to 10.3.3, Xcode 8.3.3 cannot find it in the Device window but iTunes can. Restarting Xcode fixed the problem.


N
Nick Sarafa

After 20 minutes of debugging, I realized I had to hover over the up button (🔼) at the top of the Devices picker in the top left hand corner, to the right of the run app button 😂


R
Red Rooster

The error I had in XCode was "iOS version lower than deployment target", which I didn't know how to fix. The error was displayed where the iPhone should have been indicated as a Device (upper left). I selected the project in Project Navigator and noticed that the iOS Deployment Target was set to 11.3 but when I checked my iPhone it was set to 11.2.1 (or something lower than 11.3). So I opened Settings on the phone, scrolled down to General and tapped Software Update. Since the update said it was scheduled but didn't start, I decided to take the SIM card out of my other phone and put it in the iPhone I was using for testing. Then the upgrade started quickly. After the Update finished on the phone, however, XCode still didn't recognize the phone. I unplugged the USB cable but didn't hear any sound, so I plugged it into another USB port on the computer and then heard a sound. Then XCode noticed the phone. So the problems were that the iPhone didn't inform me that I had an Update (or I ignored it and forgot about it) and it may have needed the SIM card, and I had a bad USB connection.


L
LucasKarlsson

Had the same problem. In my case it was my usb cord.


S
Satish

I had this problem. I somehow registered the device for generic team on apple. I don't remember how I did it now. Then I was able to overcome this error.


Here is how I solved it. It never connected in first shot. I had to retry 8-10 times and finally it connected. Once it got connected in organizer I went to devices, selected this device and under this I selected provisioning profile. Right clicked then I got the option add device to provisioning portal. Then I added giving apple id. From next time onwards I was able to connect the first time itself.
v
varun

Just unplug the cable of iPhone with your mac and then plug cable in mac work for me.I hope it's work for someone.


perfect help ! No one ever thought about it. Congrats
w
whittwuli

Xcode 6.3 didn't see my iPhone running iOS 8.3 even after a computer restart. I then restarted my iPhone and everything worked again. Love buggy software!


k
kit

When you trying to build and run the current scheme but encounter this alert message:

"The run destination iPhone is not valid for Running the scheme."

Plus you already check your phone and it is connect to your Mac properly, all you need to do is just simply restart your Xcode and build it again. That will do the job.


D
Dark

Ran into this issue having upgraded from XCode 9 to 10.1. No devices at all were appearing in XCode, despite performing all the steps listed in other answers.

For me the solution was to do a clean CMake build, deleting the old Xcode project files.


M
Mike Volmar

Xcode 10.2.1 was not recognizing my ipad mini. I unplugged and rebooted the mini and it became visible.


M
Milad Jafari

The problem was solved for me when I used an original cable. You also get an original cable.