Xcode 11Could not attach to pid

I find a weird issue, every time when I close my WiFi, then Xcode command+R running my project on simulator will be failed with error like:



Details



Could not attach to pid : “1682”

Domain: IDEDebugSessionErrorDomain

Code: 3

Failure Reason: Error 1

--

Error 1

Domain: IDEDebugSessionErrorDomain

Code: 3

--



and when I open Wi-Fi, and connect to Internet, run on simulator will be fine.

My Xcode version:Version 11.3.1 (11C504)

OS: macOS Catalina 10.15.3 (19D76)



I have googled and found some similar issue like this one https://forums.developer.apple.com/thread/120282

I tried all the solution I have googled, but none of them helped in any way.😟

Does anyone know how to solve this issue, or this is a bug of Xcode 11?

Thanks for any help!

Xcode 11Could not attach to pid
 
 
Q