Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 8 | iOS 10 simulator "Error returned in reply: Connection invalid"

Even I was getting the same error. Issue in my case was I was working on xcode 7.3 and its simulator was open, later on I closed xcode 7 and opened xcode 8 and tried running app and got the above error.

I guess its happening because of both the simulator were open, it got solved when I closed my older simulator. Seem to be some problem while xcode 8 was trying to establish connection with simulator.


You just follow these steps to remove this error it's working fine in my side and i hope these steps work to you also just try it.

 i)Remove multiple xcode versions.
ii)Quit all Xcode and simulators. 
iii)Only one version you opened.
iv)Go to Xcode  -> Preferences

enter image description here

v)Go to Location enter image description here vi) Set proper version for command line tools (your Xcode version)

vii)click on Derived Data enter image description here

viii)Then go to Derived data and delete that folder. see below image enter image description here

ix) Click on Simulator reset content settings and just quit xcode and simulator and open clear and build the xcode and run it.


Without deleting "Derived data" folder

The same rules as in the past apply to switching between Xcode 8 and Xcode 9:

  1. Quit Xcode, Instruments, Simulator.app, and Console
  2. xcode-select the version you want to work with
  3. Start the version of Xcode you want to use

If these steps don't resolve the problem for you, you can repeat the steps above > but after #2 add "sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService".

from this https://forums.developer.apple.com/thread/79301


The Same issue I have faced when I have two Xcode version, but the issue was when we are opening the two instances of simulator we will get the same error, the best way to solve this issue is run command

rm -rf ~/Library/Developer/Xcode/DerivedData 

to remove the derived data.


None of the above worked for me.

Instead of choosing the simulator and hitting "run" i solved it by opening the simulator form "Open Developer Tool" menu first. After that all worked fine.

enter image description here