Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Testing location-aware apps without moving

Testing location-aware apps without moving

Ever thought you wanted a way to test your location-aware app in a (simulated) real-world environment, without actually getting off your seat? In this talk, we will explore cool ways to test your app by simulating Core Location to better mimic the real world.

Deepank Vora

October 20, 2017
Tweet

Other Decks in Programming

Transcript

  1. How can we simulate movement? • Xcode presets • GPX

    track • Simulated location manager
  2. How can we simulate movement? • Xcode presets • GPX

    track • Simulated location manager
  3. How can we simulate movement? • Xcode presets • GPX

    track • Simulated location manager
  4. We did well to simulate coordinates But.. . What about

    the other attributes of a location?
  5. CLLocation attributes • var coordinate: CLLocationCoordinate2D • var altitude: CLLocationDistance

    • var floor: CLFloor? • var horizontalAccuracy: CLLocationAccuracy • var verticalAccuracy: CLLocationAccuracy • var timestamp: Date • var speed: CLLocationSpeed • var course: CLLocationDirection
  6. How can we simulate movement? • Xcode presets • GPX

    track • Simulated location manager
  7. Delivery of location updates Client (e.g. MyViewController) CLLocationManager 1. Start

    updating location 2. Deliver location updates CLLocation objects
  8. Taking control over location updates Client (e.g. MyViewController) SimulatedLocationManager 1.

    Start updating location 3. Deliver location updates 2. Look up Location Data Custom CLLocation objects