Developing Private In-House Libraries with CocoaPods
June 25th, 2014
CocoaPods is the dependency manager we use at Object Partners to integrate open source iOS libraries. We also use it to manage private libraries for our iOS apps.
Most of the time if you use the Core Location services in the iOS simulator it will default to Cupertino, but there are times that it will give you a kCLErrorDomain code of 0, or you may want a different location for testing. It turns out that if you edit the run scheme of your project, you can choose whether to allow location simulation and there is a drop down of predefined locations.
But what if you want a location that isn’t in the list? It turns out that there is an option for adding a GPX file to the workspace. Just get the latitude and longitude of the location you want to use (Google Maps is good for this). Then head over to GPS Visualizer. Plug in your data and ask for a GPX format file as shown below:
You definitely need the “header” lines in the “paste your data here” box, otherwise the service doesn’t know what your data means. For the example above, I used OPI’s home city of Minneapolis, Minnesota.
Now you can choose to import this file from the Options panel in Edit Schemes and presto! You can now test your application in the simulator and have it give you the current location you want.
As a bonus, here’s the GPX file for Minneapolis. Enjoy!
Minneapolis, MN
Minneapolis, MN
Steve is a Principal Consultant at Object Partners where he has been focusing on developing an enterprise mobile development practice, delivering applications to client that include: Oracle Retail, The Tile Shop, St. Jude Medical, SICK USA and Donaldson Corporation. He has over 20 years of experience developing solutions from embedded to large-scale Java Enterprise web applications for diverse clients including IBM, Sun, Novell, Best Buy and Thomson Reuters.