Xcode 8 | iOS 10 simulator "Error returned in reply: Connection invalid"
IosXcodeIos SimulatorIos10Xcode8Ios Problem Overview
While I am try to run an app in the iOS 10 simulator using xcode8
I get these alerts frequently. They randomly appear two at a time and it is not apparent what is triggering them.
Below is Image for Error I got.
I tried Following things.
- Clean & Rebuild an app
- Restart xcode & Simulator
- Clear Derived Data & Rebuild application.
Ios Solutions
Solution 1 - Ios
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.
Solution 2 - Ios
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
v)Go to Location vi) Set proper version for command line tools (your Xcode version)
viii)Then go to Derived data and delete that folder. see below image
ix) Click on Simulator reset content settings and just quit xcode and simulator and open clear and build the xcode and run it.
Solution 3 - Ios
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".
Solution 4 - Ios
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.
Solution 5 - Ios
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.
Solution 6 - Ios
I had a similar issue, despite not launching a second instance of the simulator, due to using SimPholders and having the XCode Command Line Tools set to a different version of XCode. To resolve this, open up XCode preferences, and under the Locations tab ensure that the Command Line Tools version matches what version of XCode you're currently working in.
Solution 7 - Ios
I had the similar issue shown in below screenshot.
Got it solved by closing Xcode 7 and its simulator.
It seems that when you are working on Xcode 8 and its simulator then Xcode 7 simulator should not remain open.
Below is screenshot of simulator state for Xcode 7 when you're working on Xcode 8.
Solution 8 - Ios
In my case, I was open a project a Xcode 8, and the emulator for this version, then open this project on Xcode 7.3.1, when I create an emulator it shows the alert.
My Solution: Close all version of Xcode => Clear Derived Data => Quit Xcode => Open Xcode => Choose File => Open Recent.
Solution 9 - Ios
Force Quit.. Xcode and simulator. This kind of issue happned because maybe you are try to run more than one different version Xcode at same time.
Solution 10 - Ios
I just had this issue when attempting to debug an iOS application from Xamarin, which uses Xcode to run apps in the simulator. I was initially targeting a 9.7" iPad Pro, attempted to change the simulated device to an iPad Air 2 (still on iOS 10), but the simulator didn't respond. After quitting and relaunching the simulator it appeared to load okay, so I changed back to the previous device - not sure whether changing devices actually did anything but I haven't seen the error message in the few times I've run my app since.
Solution 11 - Ios
Solved it by closing all xcode and simulator. Don't ask me why. It was happening on the beta version for me
Solution 12 - Ios
I had similar issue, what I did is I closed the simulator and all the Xcode and I went to the terminal and typed to see any Xcode application running then I killed it. I had one Xcode running in the background.
Command to see if Xcode is running,
ps -e | grep -i xcode
Use kill comment to kill any runing Xcode app, I used
kill -9 <pid>
Solution 13 - Ios
The Same issue I have faced in my case i stopped all applications and restarted my mac and every thing is OK
Solution 14 - Ios
Simple And fast Remedies..
1.Quit all xCode and reopen the xCode which you need to work...
Solution 15 - Ios
I had this problem too, but I did below process it's working fine.
You have both Xcode 8.x.x and 9 running on your Mac, which causes the problem. Only run one Xcode at a time (Quit another Xcode, don't let another Xcode runing in background!).
Solution 16 - Ios
This can occur when you have more than one version of Xcode installed on your computer. Make sure you QUIT (not just close) all versions of Xcode first.
Solution 17 - Ios
Changing the device seems to have worked for me after doing the other stuff. Didn't have to restart my computer.