Xcode “Device Locked” When iPhone is unlocked

前端 未结 30 2058
失恋的感觉
失恋的感觉 2021-01-29 18:53

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?

相关标签:
30条回答
  • 2021-01-29 19:35

    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

    0 讨论(0)
  • 2021-01-29 19:35

    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.

    0 讨论(0)
  • 2021-01-29 19:36

    All the previous solutions didn't work.

    Finlay, changing the iPhone's cable solved the problem.

    0 讨论(0)
  • 2021-01-29 19:38

    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)

    0 讨论(0)
  • 2021-01-29 19:38

    A simple solution:

    1. First, unplug your device.

    2. Now, unlock your device and plug it in again. Be sure that the device is unlocked.

    3. Now run the Xcode project by selecting the device as target.

    0 讨论(0)
  • 2021-01-29 19:39

    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!

    0 讨论(0)
提交回复
热议问题