Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 10 - iOS 12 Simulator location simulation fails on City Bicycle Ride/City Run/Freeway Drive

I just updated from Xcode 9 to Xcode 10 a day ago, and when I was about to debug my location tracking app just realized that I never received device location. So I went to Maps app to check if it was just a problem with my app, but when I turn location debug to any dynamic location (City Bicycle Ride/City Run/Freeway Drive) even Maps fails getting device's location (almost always), but when I set it to a static location (Apple) it works without any problem.

Location: Apple

Location: Apple

Location: City Bicycle Ride

Location: City Bicycle Ride

Location: City Run

Location: City Run

Location: Freeway Drive

Location: Freeway Drive

I'm the only one facing this issue or its actually a Xcode/Simulator problem?

EDIT: Still happening on Xcode 10.1

like image 388
Jose Vf Avatar asked Sep 20 '18 17:09

Jose Vf


People also ask

How do I simulate a location in Xcode 12?

Allow location simulationSelect Run | Edit Configurations from the main menu or Edit Configurations from the run/debug configuration selector on the toolbar. Choose your configuration from the list and go to the Options tab. Select the Allow Location Simulation checkbox and click OK.

How do I change simulator location in iOS?

To simulate location on a Simulator, select Features menu > Location, then you will see a list of location and movement options you can simulate. A list of location and movement options you can simulate in a Simulator.

How do I enable location in simulator?

Open Android Studio, and launch your AVD in the emulator. Then, on the options bar for your device, click the icon for "More" and navigate to the "Location" tab. If you don't receive the locations in the emulator, you may have to turn off "Improve Location Accuracy" in Settings - Location in the emulator.

How do I reinstall Xcode simulator?

Open Xcode and click Menu > Xcode > Preferences > Select Components, and then choose the simulator version you want to download. When a simulator is opened from AppStudio, AppStudio Player automatically installs (if necessary) and opens in it.


2 Answers

Still happening in Xcode 10.0, and the only thing that seemed to make it work was to have 'Allow Location Simulation' turned on in your scheme and toggling between 'Apple' and 'City Run' under your simulator's top menu:

Debug > Location > Apple

Debug > Location > City Run

(back and forth between them until your run actually begins to simulate)

  • Obviously not a permanent solution, but it can save you hours of debugging your own code vs pulling your hair out, yelling at Apple. Though we should def yell at Apple for this one.
like image 189
klopez Avatar answered Oct 31 '22 14:10

klopez


What works for me is to go to Settings in the simulator and turn off and back on the location services under privacy. Then choose debug > location > apple > devised activity

like image 6
Starkus Avatar answered Oct 31 '22 15:10

Starkus