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
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:
Make a shell script file with this command:
#!/bin/sh
killall SimulatorBridge
Save it in ~/Library/Developer/Xcode/UserData/Behaviors/
as KillSimulatorBridge.sh
.
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.
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.
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.