Forum Xamarin Test Cloud (Read Only)

DeviceAgentException: Unable to set location

Hi guys,
I am trying to set a fake location in Xamarin.UITest. This works fine on Android, but with iOS, I get the following exception:

SetUp : Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Unable to set location

ExitCode: 4

        -d,--device-id  <device-identifier> iOS Simulator GUID or 40-digit physical device ID
    set-location <latitude,longitude>
Expected lat,lng: Got 48,135831,11,573423

The code I use to set the fake location is the following:

App.Device.SetLocation(latitude, longitude);

...where latitude and longitude are variables of type double which contain the desired coordinates.

I saw another thread on this forum where they said that it might help to round the fake coordinates to 4 digits after the decimal point, but it didn't help. Also, using float instead of double as the datatype for the coordinates didn't do the trick.
What is going on there and what can I do to fix it?

Thanks in advance everybody!

My setup:
Xamarin.UITest version 2.2.1
iOS Simulator running iOS 11.2 on an iPhone X
Host computer: Mac Mini running MacOS High Sierra (10.13.3)


Sign In or Register to comment.