GPX Location Manager Fork
A way to simulate location in iOS
First Commit: | December 2016 |
Website: | Github |
Languages: | Swift |
Technologies Used: |
|
Tools Used: |
|
Problem
iOS developers who use CoreLocation frequently are often thinking about how to test their work. In the past Xcode had a nice way to simulate locations using GPX files, however a drawback was the altitude and course could not be simulated. To get over this, developers used Automation Instruments to set the location that would be passed into the LocationManager. This was great as it allowed developers to test their location based apps within Xcode using JavaScript. The code looked something like this (Courtesy Sergii Nezdolii):
Unfortunately, with Xcode 8, Apple decided to remove the Automation Instruments tool in hopes that developers would start using the UI Testing Infrastructure more widely.
Goals
When Apple decided to remove Automation Instruments, I was annoyed as I had put a lot of effort to build files to test my apps with it already. Unfortunately, there wasn’t much that I could do other than start looking for a new way to test. The main goal was to find a way to simulate location.
Outcomes
After many attempts to find something to test with, I stumbled upon the GPX Location Manager repo. I quickly realized that it may work and added the Cocoa Pod to my project. When I first tested it, I quickly realized it was not simulating the speed or course that I was passing into it. I started looking into the files and realized that I could modify the code to accept those and did that. I’m happy to say I found a way to simulate location once again.