Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode: Debug => "Simulate Location" menu item not available (greyed out)

Tags:

I cannot seem to add any simulated location to the simulator, as the corresponding menu is completely greyed out, as shown in figure:

enter image description here

the location works well when debugging with the actual device.

any idea?

like image 419
Fabio Napodano Avatar asked Jul 25 '14 08:07

Fabio Napodano


People also ask

How do you simulate location on iPhone?

With your iPhone or iPad plugged in, select Toolbox at the top of the program, and then VirtualLocation from that screen. Select somewhere on the map, or use the search bar, to choose where you want to fake your location. Select Modify virtual location, and then select OK when you see the confirmation prompt.

How do you simulate a location in Simulation?

Click the location on the map you want to simulate, and then press the lowercase L key. A dialog will appear with the message, “Simulated Location Set”. After a short time, the simulated location you set in the Editor will appear as a pink dot in the Android Emulator. Click anywhere on the map, and press Shift+L.


1 Answers

The iOS Simulator must be running your app before that menu will be enabled. For me it appears immediately after a successful build.

If it's proving inconvenient to make a selection in that menu between build of your app and it's launch, I would recommend setting a default location via Product -> Scheme -> Edit Scheme. You can then select your preferred default in the Run / Options panel after checking the "Allow Location Simulation" box.

Xcode : Default location option

like image 153
Ben Thielker Avatar answered Sep 20 '22 11:09

Ben Thielker