How to simulate location on the iOS device
Even if you are not an engineer, it could be useful to know how to simulate location on the iOS device. As a Product Designer at Yandex Maps, I found it super useful to check features before the launch or to look at competitors in another parts of the World.
Here is list of items what you need:
- Xcode on your Mac.
- Your iPhone with Apple ID logged in
- Cable to connect your iPhone to your Mac
First of all, open Xcode and create a new project.
Then, fill the product name and organization identifier, but try not to use something simple like “maps” because it could be taken by system app.
After you click “Next”, select place where the project should be placed.
From the menu, go to the preferences and add your Apple ID account. If you having problems to log in, try to disable VPN for a moment.
If everything is fine, you should see your account in the list
Now you can close preferences and return back to the main screen.
On the main screen, select Signing & Capabilities tab and select your team. The status with the yellow icon should disappear.
Return back to the General tab. Make sure your minimum deployment version is the same as your iOS version on your iPhone. I’ll change it to 16.1
You can check your iOS version on your iPhone by going to Settings – General – About.
Now it is time to connect your phone. Unlock it and connect it to via cable. Select it from the menu and you are ready to build.
Press “Build” in the left panel. If everything is okay, you should see sample app launched on your phone saying “Hello World!”.
Press the location button in the Xcode and select any from the list to simulate. Also, you can create your own location by using GPX Generator.
After that you can switch from sample app to any app you need.
Now every single cartographic app thinks that I’m in Tokyo and ready to test some local apps.
To avoid being stuck at simulated location, change it to Don’t simulate location and check it in any app before you stop your build or unplug your phone.