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

前端 未结 3 499
栀梦
栀梦 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.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题