Xcode blocked at “Attaching to (app name)” when I launch my app in the simulator

前端 未结 3 489
栀梦
栀梦 2021-01-21 06:30

I know there\'s a lot of posts with the same that problem. I just spent at least 2 hours to read them and I tried everything I saw in the responses but it still doesn\'t work. I

相关标签:
3条回答
  • 2021-01-21 06:41

    This problem occurs regularly for me, and the solution was always to kill the process named SimulatorBridge.

    And to simplify the solution you can add a custom 'behavior' in Xcode to do the task by following these steps:

    1. Make a shell script file with this command:

      #!/bin/sh
      killall SimulatorBridge
      
    2. Save it in ~/Library/Developer/Xcode/UserData/Behaviors/ as KillSimulatorBridge.sh.

    3. Open Xcode > Preferences > Behaviors, and add a new behavior to run the shell script: Adding custom behavior

    Now, you can run this behavior whenever Xcode hangs while trying to attach to your app, and you can even have a keyboard shortcut to run it.

    Hope this helps someone.

    0 讨论(0)
  • 2021-01-21 06:41

    Restart your computer.

    The simulator sometimes gets stuck and this is the only way I know to reset it. The same thing can happen to the device as well and you just have to switch it off and on again.

    If that doesn't work, you may have to reinstall the SDK.

    0 讨论(0)
  • 2021-01-21 06:57

    It can also happen when a different user account has the simulator running on the same computer. In that case, close the simulator on the other user's account and try again.

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