lichen19853 lichen19853 - 1 year ago 103
iOS Question

When using GPX in Xcode to simulate location changes, is there a way to control the speed?

I'm using the following GPX file in Xcode 4.2 to simulate a location change. It works well, but I can't control the speed of the location change. stamp seems to be not working. Does anyone have a solution for this?

<?xml version="1.0"?>
<gpx version="1.1" creator="Xcode">
<wpt lat="37.331705" lon="-122.030237"></wpt>
<wpt lat="37.331705" lon="-122.030337"></wpt>
<wpt lat="37.331705" lon="-122.030437"></wpt>
<wpt lat="37.331705" lon="-122.030537"></wpt>

Answer Source

I don't think (know) that this is possible in the GPX directly, but you can test location change with Instruments/Automation.

You'd use a script like:

var target = UIATarget.localTarget();

And so on. I took this example from the WWDC11 video (Testing your location-aware applications)

I'm aware that this doesn't actually let you define the speed, but the delays somehow account for that I hope. Maybe that'll help you.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download