سؤال

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