1

I am following the Trax app demo from Stanford's iOS lectures and the instructor set the app up to handle GPX files via AirDrop, but the iPhone simulator doesn't support AirDrop.

Is there anyway to add files (more specifically GPX files) to an app on the iPhone simulator? I thought about emailing it to myself and using Safari on the simulator, but I have no idea where that would be stored or how to access it from the Trax app.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
steveclark
  • 537
  • 9
  • 27

2 Answers2

6

You can add a GPX file to a project by opening the scheme editor: Product -> Scheme -> Edit Scheme. Under Options check the Allow Location Simulation box and from the dropdown choose Add GPX File to Workspace.

In order to generate a GPX file with your custom location you can use this.

Vasil Garov
  • 4,851
  • 1
  • 26
  • 37
  • 1
    Perfect. For those who want it streamlined: Product -> Scheme -> Edit Scheme -> Run -> Options -> Allow Location Simulation -> Close -> Click Location Button (bottom of screen) -> Add GPX File to Project... -> Select File -> Add -> Finish – steveclark Apr 09 '15 at 17:06
  • 1
    Is there anyway to add a GPX file through code when a user is using it? – dhruvm Jul 13 '16 at 04:36
  • @user3798602 I would like to also know this. Any luck in finding a solution? – JamesG Sep 27 '16 at 21:23
  • @JamesG no apple does not allow it. Asked them through email. – dhruvm Sep 27 '16 at 21:49
  • @user3798602 They may not allow it in the production app, but it would be awesome to have it for dev for testing etc... – JamesG Sep 27 '16 at 21:59
  • @JamesG for production, you can use an apple script to change the gpx using Xcode settings. I think that this automation of the settings changing is the best one can get. – dhruvm Sep 27 '16 at 22:14
1

The way Hegarty does it is he runs the app on his phone (when connected and registered your phone will be the first scheme on the list). Then airdrop on the Mac will see your phone and you're app will grab it.

Cheborneck
  • 11
  • 2