Xcode cannot launch the app because the device is locked
Asked Answered
D

4

12

I am getting this error when I run the app in an actual device even the device is unlocked.

enter image description here

I tried disconnecting and connecting the device, rebooting the device, restart Xcode and clean the project but every time I am getting this error. I am using XCode 10.2 on macOS 10.14.4 I didn't find solutions on SO, so posting a question here.

Edit: This problem arise eveytime when I start the system and run project for the first time.

Dripping answered 16/1, 2020 at 5:34 Comment(5)
Unpair the device and again pair it.Cynth
@SohilR.Memon Thanks but Unpair and pairing device doesn't working in my case, I know this can be a solution.Dripping
Then I think you need to delete the symbol files for your device from your PC and then try again.Cynth
In your iPhone Device Go to Setting > Developer > click in “Clear Trusted Computer” Type the passcode required, then Unpair and pairing device.Postmeridian
Found solutions for this: Unpaired device, restart Xcode 2-3 times, restart the device and paired again and keep it unlocked when running the project. Thank you all guys.Dripping
D
24

Generally, unpair and repair will resolve the issue

enter image description here

enter image description here

Then try repair again

Dvinsk answered 16/1, 2020 at 6:1 Comment(0)
E
8

Is there anything like by chance you tapped not -

"Trust This Computer" ?

This will prevent it from communicating with xcode even if the device is unlocked.

Follow a support Documentation from Apple:

Workaround

  • Disconnect your device from your Computer and close your Xcode project.
  • On your iphone go to Settings > General > Reset, then press Reset Location & Privacy

  • connect your device back into your Macbook, and on the iPhone you will be prompted to trust the Macbook. Tap trust.

  • Now reopen Xcode and rebuild the project.
  • The iPhone locked error should disappear.

Another Workaround works for people

  • unplug your iPhone
  • quit Xcode completely
  • open xcode Project
  • plug in your iPhone
  • build and run

Another Workaround

  • Go to Window -> Devices & Simulators. Right click on your iPhone & unpair it.

  • Disconnect from cable & reconnect.

  • Wait for it & let Xcode detect you iPhone.

  • Run your project.

  • Make sure you TRUST on your iOS device and enter any passcode.

Excommunicate answered 16/1, 2020 at 5:56 Comment(0)
C
0

In my case, I just forgot to connect the device via a cable

Cadge answered 21/8 at 9:51 Comment(0)
B
-1

Just replug the cable from iphone to mac and it will works

Barite answered 8/9, 2022 at 10:4 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Mascarenas

© 2022 - 2024 — McMap. All rights reserved.