I'm debugging a location-aware app, and getting frustrated with the iOS simulator. For some reason every time I run my app from Xcode the Location setting (under the Debug menu) resets to "None" (from "Custom Location…").

Anyone know how to prevent this?

有帮助吗?

解决方案

In your project select edit scheme and go to the option tab. Edit default location to your liken.

enter image description here

Check apple doc for other customizable option. If you want to create a permanent location create a GPX file with editor or online generator

其他提示

You can set it in Default location option as Shams Ahmed mentioned, but there is one more option.

If you want XCode to keep your preference you made in Debug – Location menu in iOS Simulator, simply deselect the Allow Location Simulation checkbox in the Edit scheme menu. Now the location will not be reset to "None" and iOS Simulator will respect your location setting.

I was using a .gpx file but still not working. Then I created a new one using the online generator described above by Shams Ahmed and this one is working fine now. The difference between the old and the new .gpx file was, that I was using a comma in my coordinates (14,99889), not a dot (14.99889)!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top