144

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?

Neeku
  • 3,646
  • 8
  • 33
  • 43
Vlad
  • 2,090
  • 3
  • 21
  • 37

33 Answers33

320

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:

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

Your device should now be visible again in Xcode!

starball
  • 20,030
  • 7
  • 43
  • 238
jcaron
  • 17,302
  • 6
  • 32
  • 46
  • 1
    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. – avance Dec 19 '14 at 08:20
  • Thank you!! This also fixed the "trust this computer" pop-up I was getting every time. – Erik Villegas Dec 22 '14 at 19:24
  • 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 ) – gaussblurinc Feb 05 '16 at 13:11
  • 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. – jcaron Feb 05 '16 at 14:42
  • This work - note: it happend because I deleted the mobileprovision profile file by mistake - so I had to added to organizer first. – Elia Weiss Mar 12 '16 at 09:01
  • worked on xcode 10.3 after upgraded to MacOS 10.15.1! – mylittleswift Oct 31 '19 at 15:52
  • this, plus clear derived data and clean build works for me – valeriana Aug 04 '20 at 14:59
  • Also check the USB cable... XD just happed to me, lost 1 hrs trying to find why Xcode did not see my iPhone any more!! – Pascale Beaulac Oct 09 '20 at 14:44
  • I had been running Xcode with Rosetta on my MacBook Pro M1 and that created provisioning profile issues ala [link](https://developer.apple.com/forums/thread/676083). Once I opened Xcode normally without using Rosetta, I did the above steps, voila it worked! I spent 2 days on this issues. Thanks!!!! Note: turning off Do Not Disturb and Personal focus was also necessary. Hope that helps someone. – MischkaTheBear Jan 21 '22 at 05:37
  • Good solution, but shame on Apple for such a time-wasting issue. – h.and.h Feb 27 '23 at 16:55
85
  1. Select Window ➜ Organizer in Xcode. Now under Devices, select your device. If it is not ready for development then click use for development.

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

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

Dovydas Šopa
  • 2,282
  • 8
  • 26
  • 34
iVipS
  • 1,477
  • 1
  • 14
  • 22
  • 2
    I Am Ashamed. I just forget to press "Use for development" in the XCode organizer. – Vlad Apr 10 '12 at 12:08
  • @iVips - I am facing the similar problem but I am not even getting "Use for development", how to fix this? – itsaboutcode Apr 30 '12 at 02:28
  • 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. – Ed McLaughlin Jan 02 '14 at 13:41
  • 13
    in Xcode 7.3.1 there is no "Devices" option in the Organizer anymore. Any other ideas? – kramer65 Jul 18 '16 at 06:48
  • 4
    @kramer65, it is now Window > Devices instead of Window > Organizer > Devices – Matt Jul 14 '17 at 04:37
  • 1
    My phone was plugged into an outlet, not the computer. –  Jul 29 '20 at 19:38
  • @kramer65 turning it off and on again worked for me. – Boris Verkhovskiy Jun 03 '21 at 05:57
37

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

Alex Pelletier
  • 461
  • 5
  • 13
  • 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. – kit Dec 06 '18 at 02:55
20

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

Hope it helps.

neowinston
  • 7,584
  • 10
  • 52
  • 83
Franck
  • 8,939
  • 8
  • 39
  • 57
  • 1
    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. – MrMojoRisin May 22 '19 at 15:12
  • Same my case, its was cable issue. – Trinh Tran Jul 18 '20 at 03:18
17

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.

Jeremy_inPDX
  • 1,049
  • 9
  • 9
  • 3
    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! – Mephisztoe Sep 13 '17 at 10:51
  • Tried every other solution but this is the one that workedd for me. Xcode 10.1/ iphone 6s 12.4.1 – Atak Oct 25 '19 at 08:58
10

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.

Kasper Munck
  • 4,173
  • 2
  • 27
  • 50
10

In my case I did next steps

  1. Quit XCode
  2. Disconnect device
  3. In your terminal sudo launchctl stop com.apple.usbmuxd
  4. Relaunch Xcode
  5. Connect device
Alexandr Kolesnik
  • 1,929
  • 1
  • 17
  • 30
7

May be my answer is helpful to new developer. Just follow these step , You can connect your iPhone/iPad with X-code.enter image description here

Abhishek Mishra
  • 1,625
  • 16
  • 32
4

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.

Benjamin Oman
  • 1,654
  • 1
  • 17
  • 19
4

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.

Michael
  • 8,891
  • 3
  • 29
  • 42
  • 1
    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. – amergin Sep 17 '14 at 12:03
4

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.

Sanoop Surendran
  • 3,484
  • 4
  • 28
  • 49
Vinit Nayak
  • 103
  • 1
  • 9
4

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

Arin
  • 155
  • 1
  • 7
3

Here is how I figured out the problem. Go to Xcode -> Window -> Device and Simulators -> Devices. There you could see Errors and Warnings. I found that my Xcode has to be updated because IOS version of my device is higher. enter image description here

1nstinct
  • 1,745
  • 1
  • 26
  • 30
2

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

Kibernetik
  • 2,947
  • 28
  • 35
2

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

Kirow
  • 1,077
  • 12
  • 25
2

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!

pcnick13
  • 114
  • 5
1

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

Oras
  • 1,036
  • 1
  • 12
  • 18
1

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.

superarts.org
  • 7,009
  • 1
  • 58
  • 44
1

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

Nick Sarafa
  • 986
  • 10
  • 16
1

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.

Red Rooster
  • 199
  • 1
  • 4
1

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

LucasKarlsson
  • 1,021
  • 1
  • 10
  • 16
0

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.

Satish
  • 170
  • 3
  • 12
  • 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. – Satish Apr 10 '12 at 11:55
0

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.

varun
  • 317
  • 1
  • 4
  • 18
0

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!

whittwuli
  • 231
  • 1
  • 3
  • 9
0

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.

kit
  • 1,166
  • 5
  • 16
  • 23
0

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.

Dark
  • 227
  • 3
  • 9
0

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

Mike Volmar
  • 1,927
  • 1
  • 22
  • 31
0

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

Milad Jafari
  • 1,135
  • 1
  • 11
  • 28
0

I tried all the ways here but still didn't work. I plugged the cable that I connected the phone to the computer instead of another socket and it worked.

Ugur
  • 750
  • 9
  • 20
0

This is absolutely bizarre! Xcode has been working fine with my iPhone for weeks, and today it stopped working. None of the tips above worked.

Finally I switched the cable from the left hand side port to the right hand side port, and now Xcode is recognizing my phone! PHEW!

But only on that specific port. Going back to the left hand side port still doesn't work!?!?!

Pratik Stephen
  • 2,175
  • 1
  • 11
  • 11
0

I followed all the steps above and the device was no longer visible in Xcode. The device was visible on my mac (on each new connection attempt). I have disconnected the device several times. The solution which worked after 15 minutes was to connect the device with a braided (original) iPhone cable, rather than an older regular (original) cable. I guess Apple is telling me to buy new cables...

Darkwonder
  • 1,149
  • 1
  • 13
  • 26
0

I'm facing same issue in XCode 14.2(14C18). In my case I've tried all the following steps, Deleted Derived Data, Cleaned project build folder, even Restarted XCode didn't worked. Tried below steps and device is visible again

  1. Quit Xcode
  2. Disconnect the device
  3. In a terminal, type: sudo pkill usbmuxd
  4. Restart Xcode
  5. Connect the device
steveSarsawa
  • 1,559
  • 2
  • 14
  • 31
0

In my case It was my USB port. I am using Macbook air M1. First USB-C port is connected but the second one only did charging.