I get the "Xcode cannot launch MyApp on My iPad because the device is locked. Unlock device to continue" message upon hitting build&run on XCODE 8.2 on an Ipad Air 2 (actual device, not simulator), after "build succeeded" when the device is actually not locked. I tried doing it with locked device in order for it to detect the unlock as usual, to no avail. Clean project, nada. It is quite annoying and happens very often. Has it happened to anyone else, and does anyone know any work around? Seems to be an XCODE 8.2 bug?
XCODE 8.2 wrongly detects locked device
3.3k Views Asked by Apneist At
4
There are 4 best solutions below
0

solution offered by @Karbaman didn't work for me recently.
I cleared it by starting another project in xcode on another device (xcode 9 makes it nice with the wireless networking) and then coming back to the target project.
Still not 'easy', but certainly better than restarting xcode!
UPDATE: Another way that worked for me was the 'simple' method of turning off WiFi on the Mac, waiting for it to not show the connection under 'Devices and Simulators' and then turning WiFi back on. When it came back up, all my test phones came back as connected. This certainly seems to be the best method if you have several phones connected!
Quit XCode Open XCode Build/run
This should Work for you and as this worked for me.
This is consistently happening from XCode 6, You need to really "Think Different" to solve this kind of issues.