André Junior
André Junior

Reputation: 234

Simulate Location with Xcode 11

Well, I am trying to activate Location in my iOS Simulator, but I got unaccessible greyed options. Like this:

enter image description here

I read about Products > Schemes > Run > Options... But there's no options for Location in there. Like this other image:

enter image description here

Can somebody help me? How can I do this in Xcode 11? Thanks in advance!

Upvotes: 2

Views: 6822

Answers (4)

ctrl freak
ctrl freak

Reputation: 12405

Xcode 13

You can simulate location in either Xcode or Simulator. For a custom location (with custom coordinates), however, you must simulate location in Simulator, not in Xcode because Xcode does not offer this feature. And to do that you must disable location simulation in Xcode (because it will override Simulator if enabled) and enable it exclusively in Simulator.

To do that, in Xcode, go to "Product", "Scheme", "Edit Scheme" and set "Default Location" to none and uncheck "Allow Location Simulation". Then in Simulator, go to "Features", "Location", "Custom Location" and enter in coordinates.

Upvotes: 0

Phong Nguyễn
Phong Nguyễn

Reputation: 13

If you want to set/fake location for simulate with Xcode 11 or later.

  • Step 1: Run your project with any simulator model.
  • Step 2: On Dock bar, select to this simulator.
  • Step 3: On Navigation bar. select "Features -> Location -> Custom Location..."
  • Step 4: in "Custom Location" table, you insert Lat-Lng to this table.

enter image description here

Upvotes: 1

amazing
amazing

Reputation: 191

On Xcode 11 and later, you need to go to the Simulator. Open "Features" in the menu, then select "Location".

Upvotes: 5

Munzareen Atique
Munzareen Atique

Reputation: 478

You just need to go to the simulator open Debug menu -> Location and all set. enter image description here

Upvotes: 3

Related Questions