AWSSET
AWSSET

Reputation: 417

Simulate fake location on real iOS device

I want to simulate fake location on my iPhone 5S device using specific longitude and latitude. Is there a way to do this in XCode. I tried using the simulate location feature by adding a GPX file in XCode but it's not working. Thank you in advance.

Upvotes: 30

Views: 44465

Answers (2)

Jon Schneider
Jon Schneider

Reputation: 26973

In addition to the method for setting a simulated location at runtime as mentioned in this answer, you can set/change the default simulated location for a default device/configuration prior to runtime in Xcode at:

Product (menu) > Scheme > Edit Scheme > Options (tab) > Default Location

Xcode Edit Scheme window with Options tab and Default Location selection shown

Upvotes: 6

buttcmd
buttcmd

Reputation: 651

It is possible.

You only have to: 1) plug your device to the computer. 2) run an app in the real device (it is the same which application). It is only to have the menu enabled. 3) in Xcode (not in the simulator) Go to menu: Debug -> Simulate Location and select one or add a GPX file.

It will simulate the location not only for the application executed but for all of them.

I suppose that the phone must be in developer mode but if you run apps from Xcode it must be anyway.

I've tested it from Xcode 6 in an iPhone 4 iOS 7.1.2

Hope it helps

Upvotes: 41

Related Questions