iOS Simulator Reverts Location Setting

[亡魂溺海] 提交于 2019-12-06 20:33:20

问题


I am using a Custom Location under Debug --> Location --> Custom Location

While this setting does work just fine for me, the simulator frequently changes my setting from Custom Location to None. This reverting does not appear to have a pattern as I may run the same project 5 or 10 times without the setting reverting. Other times it changes the Location to None every 1 or 2 times I run the simulator.

Is there a way to lock the setting in so I do not have to fight with it?


回答1:


Have you tried setting a default location? May be it is set to none.

Edit your scheme > Select "Run XXXX.app / Debug" > Select "Allow Location Simulation" and select a default location.




回答2:


The accepted answer it is a solution, solved your problem, but for other developers that are facing this issue, there is also a easier solution where you don't need a GPX file or to select one of the locations provided as default:

  1. In your Xcode go to Product > Scheme > Edit Scheme...
  2. In the Run projectName/ Debug, go to Options and Deselect "Allow Location Simulation".. yes uncheck it!
  3. Press OK

  1. Run your app in the simulator
  2. On simulator menu choose Debug > Location > Custom Location
  3. Specify latitude/longitude coordinates

Now the simulator will keep this as default location. Actually the Allow Location Simulation on Xcode, together with the option none is the reason for "forgetting" the location you added before.

From now on, your simulator will always remember the last custom location!



来源:https://stackoverflow.com/questions/19719276/ios-simulator-reverts-location-setting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!