Using KML file for iOS Simulator

Read Time:1 Minute, 26 Second
(Before beginning, there may be other ways to use KML. I am just beginner in iOS programming and this is how I work around.)

XCode allows to simulate the locations using GPX file type.

One of location tracker, Google Latitude, allows to download recorded locations to KML file type.

To use KML file for iOS Simulator, you can just convert KML to GPX file.

Simple instructions below explains how to convert KML to GPX and use GPX in iOS simulator.

1. Export KML file from Google Latitude

2. Open and convert KML to GPX

3. Add converted GPX file to XCode project.

4. Open GPX file and remove below parts

       <name><![CDATA[Location history from XX/XX/2013 to XX/XX/2013]]></name>
        <name><![CDATA[Latitude User]]></name>
        <desc><![CDATA[Location history for Latitude User from XX/XX/2013 to XX/XX/2013]]></desc>

5. Change trkpt and Replace to wpt in GPX file

6. Save GPX file and Run your project

7. On Debug Area, you can find GPS icon. If you click GPS icon, you can see added GPX file on the list. Just click the file and you will see simulator is simulating GPS locations in GPX file.

Screen Shot 2013-06-23 at 12.56.39 AM









In this tutorial video, the application is from Chapter 62 – “iPhone iOS 6 Development Essentials” written by Neil Smyth.



Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.