Location Speed on Eclipse?


Hi guys,
I must simulate a navigation for a driving app.
I can’t use apk to do it because i’m using for the solution Appium+Eclipse and I run it on AppCenter, so i can use only 1 app.


I’m using the method set location, it works, and i have simulated a 30 points trip, but my app don’t register any speed, and i need it because without that it can’t record my trip

Is there a method that can put speed on my locations?


no no! you should make speed yourselve!
your app registering your location from time to time and generating speed from it. so you just need generate location changes while app running.
e.g. you now in point_1 -> point_2. Distance 10km. Generate within 10 min accurate location changes from point_1 -> point_2 and your speed should be: 10km in 10 min = 60km in 60 min = 60km/h.

No aleksei, my app doesn’t register my speed from the time difference between the locations, it has a parameter “speed” captured by the phone accelerometer.

but for information, how can i control the time between point1->point2? I’m using Thread.sleep,but is useless, the gps stops and then do the trip in a very rapid way.(so i have stop->rapid trip->stop->rapid trip)
Furthermore i had a test with only setlocation script, and seeing from maps my trip, it has always " - - " as km/h.

ah so… not sure if we can control accelerometer.

On real devices there is a way to provide speed parameter to setGeoLocation call on real devices, although this is probably not exposed explicitly to a separate client API. Basically, what is needed, is to call the POST /session/:sessionId/location endpoint with {"location": {"longitude": 0.0, "latitude": 0.0, "altitude": 0.0, "speed": 0.0}} parameters. See https://github.com/appium/appium-adb/blob/ff592e95c4ef2350f296d564d6a4c56a585d8b66/lib/tools/settings-client-commands.js#L185 for more details.

Hi mykola,
i’m having various problems to automize this way.

Can u advise me other ways to implement the speed?
Is it truth that Visual Studio can simulate a trip? Do you know how do it?