I'm trying to run UITest locally for an iOS app, and I keep getting this error:
SetUp : Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Unable to contact DeviceAgent
----> System.AggregateException : One or more errors occurred.
----> Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Unable to contact DeviceAgent on 127.0.0.1
----> System.Net.Http.HttpRequestException : An error occurred while sending the request
----> System.Net.WebException : Error: ConnectFailure (Connection refused)
----> System.Net.Sockets.SocketException : Connection refused
This happens on all simulator I've tested (and on a real device it never worked).
Both the iOS app itself and the test code are under the same solution, so the app project is included as part of the test project.
It did manage to run once, but it stopped working. I'm not sure since when, but I think since I copied to solution files to a different location.
However, even in the new location, I've managed to debug the test a couple of time after I copied to solution (so I don't think that the location of the solution is related), after changing the Xamarin.iOS debugging port in the project settings, but that trick doesn't seem to work anymore.
The DeviceAgent seems to be installed on all of the simulators, but it does not starting, only after the test fails (and then it starts, and do nothing).
The iOS app is using the Xamarin.TestCloud.Agent version 0.21.4, and the tests project is using the Xamarin.UITest version 2.2.3.
I've look through the forum, and found similar errors, but the solutions were to update some packages, and I've got everything updated.
What can be the issue?