Xcode Will Continue When Apple Tv is Unlocked
Xcode "Device Locked" When iPhone is unlocked
When I tried to build and run, Xcode said my device was locked. I looked at my iPhone, and it's not locked at all. How do I fix this?
My phone was set to "trust" the Mac, and I still ran into this error with Xcode 6.1.1.
This worked for me:
- unplug device
- quit xcode
- open xcode
- plug in device
- build/run
Did you by chance not "trust" the device? This will prevent it from communicating with xcode even if the device is unlocked.
Update here's a support doc from Apple: http://support.apple.com/en-us/HT5868
I recently ran into this issue with XCode 8 just after updating my device from iOS 9 to 10. The exact error I received was:Development cannot be enabled while your device is locked. Please unlock your device and reattach.
I received this error even when my phone was unlocked, and after unplugging and re-plugging in the device.
As is mentioned in several answers, the device is locked
message is actually referring to the device not trusting the MacBook. In my case, I think my phone defaulted to not trusting my computer after updating to iOS 10. Here are the steps that worked for me to reset the settings (this is the same process that is mentioned in the Apple support page in tehprofessors' answer):
- Disconnect your device from your MacBook and close Xcode.
- On your device go to
Settings > General > Reset
, then tapReset Location & Privacy
- Plug your device back into your computer, and on the device you will be prompted to trust the computer. Tap trust.
- Now reopen Xcode and rebuild the project.
- The
device locked
error should disappear.
From the Window Menu in top bar of Xcode, select Devices and Simulators.
(or Press SHIFT + COMMAND + 2)
Then select your device, right click and select Unpair.
Once you do this Trust or Don't trust will appear on your device.
Trust the device again and it will begin preparing it for Development.
Wait for Xcode to pair device for development and then you are good to go!
I ran in to the same issue even though i selected "Trust this computer" option first time.
This worked for me
- Lock the device
- Remove cable from device.
- Unlock the device
- Connect again to Mac
2018
The fastest way for now i found is:
1) Go to Window -> devices (changed the hotkey in xcode to CMD+P for me)
2) Press unpair on the device.
3) Press trust in iPhone.
4) Build again or Run without building (Ctrl+CMD+R)
Rebooted my iPhone, and that fixed it for me.
I tried every answer on this page (7 at the time, though 2 are duplicates) and they were all unsuccessful for getting rid of this Xcode error for me.
I have a very simple solution which worked for me instantly. Takes some 10 sec to do:
1) Go to Window -> Devices & Simulators
and untick Show as run destination
2) Unplug the cable and plug it back in.
3) Run the project.
This should be solving your problem!
For anyone who need a logical answer..
- Go to Window -> Devices & Simulators. Right click on your device & unpair it.
- Disconnect from cable & reconnect.
- Wait for it & let Xcode detect you device.
- Run the project.
- Make sure you TRUST on your iOS device and enter any passcode.
This happens at times while using Xcode 9.
There are multiple solution to this as mentioned below :
Note : Make sure that your device is not locked when Xcode is trying to install app.
Solution 1 :
i. Disconnect device
and connect again
Solution 2 :
i. Restart you device
Solution 3 :
i. Disconnect device
ii. Quit Xcode
(Shortcut key : cmd + Q)
iii. Open your project
iv. Clean project
(Shortcut key : cmd + shift + K
)
v. Now connect device
vi. Run
your project
For me Solution 3 worked perfectly
For those who has this issue in Xcode 9: Simply restarting Xcode should solve the problem.
A simple solution:
-
First, unplug your device.
-
Now, unlock your device and plug it in again. Be sure that the device is unlocked.
-
Now run the Xcode project by selecting the device as target.
I run into this problem quite often (at least like 5 times a week). Almost every time this happens, a Xcode restart fixes it. But this time nothing seemed to work including:
- Restarting Xcode;
- Unplugging and re-plugging the iPhone;
- Cleaning the project (cmd+shift+k);
- Cleaning derived data (cmd+option+shift+k)
Done dozens of times in all sorts of different orders.
What fixed the issue for me this time was simply:
✅ Rebooting the Mac.
When you plug in your iPhone, it will ask you to trust the computer. If you already trust and unlocked but still said your device was locked (bug). Just unplug and plug again then it will work
These steps worked for me in iOS 10.
- Remove the cable from device.
- Plug in the device.
- Clean and build the Xcode project.
There is a simple way to resolve that. At least it works for me. In your iPhone Device Go to Setting > Developer > click in "Clear Trusted Computer" Type the passcode required And done!!!
The simplest way that I found.
Recently I have met the Xcode shows "development cannot be enabled while your device is locked, Please unlock your device and reattach. (0xE80000E2).
If your iOS device is already unlocked and connected to mac and still get the error from Xcode 8.1 after upgrading to iOS 10.1.1, then the mac is not trusted by the device.
To fix it, first disconnect device to mac and then go to iOS settings app, and open general->reset->Reset Location & Privacy.
Then connect device to mac and when prompted, set select trust the mac.
Then wait the processing symbol files within your device and mac. After it finished, you can run the project to your device. It will be working.
This issue is not about "Trust" or not. It's a bug in Xcode.
Just follow these steps.
When Xcode is running and your device is connected:
- Lock your device.
- Unplug your device from Mac.
- Unlock your device.
- Plug your device back to Mac.
Solution: Switch target device to some other (e.g. Generic iOS Device),
then unlock you physical device and switch back to it again.
there are two solution worked for me. 1) disconnect your device from the mac and reattach it. 2) disconnect your device from the mac and restart it and then connect it with mac it'll work
Generally just unplugging/replugging seems to work for me. But today it didn't and something else seems to have worked: I have enabled network debugging on the device in question and it almost looked like it remembered an old network "lock" setting, while not seeing that the device was actually connected via USB. After (temporarily) de-selecting "Connect via Network" and replugging, it got things working again.
Lots of answers, but the one that worked for me (El Capitan, Xcode 8.2) was to close iTunes. If that has a connection to the IOS device then although Xcode can load the app components it will still fail to run it.
sometimes your device stops trusting your PC for no reseaon. go to your settings then general > reset > reset location and privacy. and replug your device to your PC again and press "trust this device" prompt that shows up in your phone.
This can also happen due to pending update on your device. This also means you need to update your phone, connect to the MacBook (trust it if needed). This how I found my problem and solution.
On your device (iPhone/iPad) goto: Settings -> Developer -> Clear Trusted Computers worked for me.
One possibility worth checking, if none of these other solutions work, is that there is no space left on the device. Xcode will not give you a helpful "device full" error to tell you that your device has no storage space left, but it will also not be able to deploy an app build to a device whose storage is full. The only solution in that situation is to delete media or other apps/data to free up enough space.
I found that by shutting down a Console and a running Simulator allowed XCode to see my iPhone again. I'd make sure other related programs aren't running if you don't need them.
Another fix to this problem is to connect your iPhone with your Xcode open while your iPhone is in the homescreen, not in lockscreen or with an app opened.
I had to re-add device to xcode.
In XCode open Devices and Simulators (CMD+Shift+2), in left list press + button and re-add the same device.
All the previous solutions didn't work.
Finlay, changing the iPhone's cable solved the problem.
Related Topics
xcode
ios
device
iphone
Comments
7 years, 11 months ago
lock it and unlock it again7 years, 11 months ago
tried it, still no luck7 years, 11 months ago
I'm not sure what you mean by "trust"...how do i enable that?7 years, 11 months ago
Unplug the device, close xcode, and then open xcode and plugin the device. When you plug it in (after unlocking it) it you should be prompted to "trust" the computer (in the iOS device). My guess is you may have accidentally tapped "do not trust" and so the device will refuse to connect to the computer.7 years, 11 months ago
I've updated the answer with a link to apple support page regarding the issue.6 years, 9 months ago
Unfortunately this is too often the solution for many of your weird Xcode woes.6 years ago
For me, unplugging and re-plugging did the trick. No need to Clean Build Folder, restart Mac with Command+Option+P+R, leave the house and come back again, burn a Voodoo doll of Steve Jobs, etc.5 years, 11 months ago
yep unfortunately only this worked for me on from Xcode 8 on iOS 10 :(5 years, 11 months ago
@BishalGhimire Yeah, it's definitely not ideal. I actually just had to do this reset again as XCode started giving me thedevice is locked
message again without any noticeable changes to any of my iPhone's settings or XCode's settings. Somewhere along the way my trust settings for my computer are being reset, but I'm not sure when and where. 5 years, 10 months ago
you should wait for a while to processing symbol files5 years, 9 months ago
Hmm... this fixed the "Device Locked" error ... but has replaced it with a "Could not save the pairing record." error ...5 years, 8 months ago
I solved this issue with disabling hotspot5 years, 4 months ago
Abhi Beckert's answer above worked for me before, this worked for me now. I spend a ridiculously large amount of my time tap-dancing around Apple's inept developers.5 years, 4 months ago
thats aApple for you! changing some value in IB's attribute inspector will make your xcode faster. lol.4 years, 12 months ago
this worked for me after iOS 11 software update on device / Xcode 94 years, 12 months ago
This saved my day! Thank you!4 years, 11 months ago
This is correct and especially true in the case of wifi debugging in Xcode 9.4 years, 11 months ago
This is the best answer which save my lot of time. Thanks4 years, 9 months ago
@NicolasMiari For me it has not worked and I am looking for the Voodoo doll4 years, 9 months ago
The same for me. With addition that I was able to debug wireless.4 years, 8 months ago
Didn't helped for me. Only setting untrusted and trust again helped.4 years, 5 months ago
The problem usually is not waiting for xcode to prepare iPhone to debug :) this worked4 years, 5 months ago
I had the same problem (update was waiting on device) but I didn't have time to update it. Asfand Shabbir's answer worked. (in case readers don't have time to update)4 years, 5 months ago
This worked. Make sure your device is UNLOCKED when you initially pair it. If not then follow these instructions to repair.4 years, 4 months ago
@NicolasMiari I've had other notifications show up at the same time I plug in my phone causing it disappear, or accidentally dismissing the prompt on my Mac... as well, if you've used mobile configurator there is a chance it's causing some weird issues as the device could be configured to only respond to one machine. Perhaps that handshake got messed up the first time you plugged it in?4 years, 3 months ago
You don't need to reboot or restart every time..check my answer: stackoverflow.com/a/50023756/96231444 years, 3 months ago
this is what I had to do as well to get the 'trust this computer?' prompt to appear when I connected to my computer4 years, 2 months ago
It's a waste of time to reboot the phone every time.4 years ago
Ah ... another one of those "jiggle the switch" solutions.3 years, 5 months ago
This one worked for me, Though, I killed the Xcode too.3 years, 5 months ago
detailed instructions for unpair can be found in forums.developer.apple.com/thread/520483 years, 3 months ago
Yeah- disabling and re-enabling network debugging often fixes it for me, when even restarts failed.3 years, 1 month ago
I'm having this problem in Xcode 11 beta and iOS 13 beta, and this worked to solve the issue of "Passcode Required" Xcode prompt when enabling wireless debugging. Thank you! :)3 years ago
It works. And now I know Cmd + Ctrl + R to run without build3 years ago
Thanks, this worked for me with XCode 10.2 when the other advice didn't. May be related to having previously ticked to be available over network then being on a rather slow wifi.2 years, 10 months ago
November 2019 and Xcode still has this problem! It hit me this morning. unplug device, quit Xcode, (go get more coffee), open Xcode, plug in, big time sink but seems to work. My other "favorite" is Xcode sees the device then doesn't see the device.2 years, 8 months ago
Thanks. This worked for me. Xcode 11.3. Funny because unplugging the cable and plugging it back in didn't work, when I didnt open Devices & Simulators window.2 years, 8 months ago
XCode 10.1 and still had to do this to get it to deploy to device. Some things never change.2 years, 8 months ago
Um, that seems to just make it not be available to select as the destination. What am I missing?2 years, 8 months ago
What if there is no Settings > Developer visible?2 years, 8 months ago
Most probably you forgot to follow the 2nd step:2) Unplug the cable and plug it back in. Run the project.
2 years, 7 months ago
@MykhailoLysenko Oh, It means you have to shutdown your iPhone's network for a moment thanks for Steven Jobs. : )2 years, 7 months ago
So wifi debugging is the problem.2 years, 5 months ago
as of the latest Xcode 11.4.1... this is till the answer2 years ago
This solution worked for me after I have tried to enable wireless. The rest of the answers did not help.1 year, 11 months ago
Tried just about everything in the book. Restarting my phone was the only thing that worked in the end. Thanks for posting that idea here!1 year, 8 months ago
If this does not work, just turn off and turn on the device again. It worked for me in Xcode 12 and Ipad with Ios 145 months, 3 weeks ago
@Dronz This is usually only visible when you had the device at least once connected.5 months, 3 weeks ago
This is the only thing that works for me. Xcode 13.3.x here.Mentions
kit
Faisal Syed
Abhi Beckert
tehprofessor
alexjrlewis
Iron John Bonney
Asfand Shabbir
Itzdsp
Nike Kov
Community
kris
Starsky
Amber K
Vlad Papko
Jayprakash Dubey
Pang
jaiswal Rajan
Keeley
Jhansi M
Roger Oba
Deepin.Do
Cleiton Domingues
Tom
Petr Lazarev
LZM
Ahsan
user3745290
brianlmerritt
Chaudhry Talha
Mateusz Kaflowski
Paul K.
Atarang
Matt Wagner
yannisalexiou
AL3MS
Martin Janeček
Source: https://bitcoden.com/answers/xcode-device-locked-when-iphone-is-unlocked
Belum ada Komentar untuk "Xcode Will Continue When Apple Tv is Unlocked"
Posting Komentar