I am creating an Uber Clone App and I go the location of the simulator which is Apples location, and when I started the simulator the location started moving, as if someone is following a path around Apple. I haven't made it to where it can move, all my code is doing is grabbing the users location. Can anybody explain why this is happening?
The location in the iOS Simulator can move because it is being simulated by software. The iOS Simulator can simulate various locations for testing purposes. The location can be changed manually in the Debug > Location menu or programmatically through code.
If you're experiencing unexpected movement in the location, it's possible that it's being changed by an app or a test that you're running. If that's not the case, then it might be a bug in the iOS Simulator and you can try restarting it or resetting it to its default settings.
Related
We have a react-native project which is working fine in the simulator and on the device. However, we are unable to open the developer menu using the shake gesture on an iOS device.
I have seen other issues but have been unable to resolve: https://github.com/facebook/react-native/issues/5122
We have the standard configuration setup in Xcode so using the debug scheme to build.
The DEBUG=1 setting is also added to the preprocessor macros:
However, when shaking the device I'm just looking stupid and the menu does not show. Any idea on how to resolve this would be appreciated.
On my Android device, I find it hard to trigger the shake gesture for the React Native developer menu -- I end up shaking the device pretty hard and on several different axes (both parallel and perpendicular to the plane of the phone) before it triggers.
Maybe try shaking harder and in more directions?
I'm trying to simulate a moving location (freeway drive) on the ios simulator, however it simply doesn't work. The only location that works is the static Custom Location... option.
To reproduce the problem:
open up Xcode>open developer tools>simulator,
open up the maps app
set debug>location to "Freeway Drive"
press the location button in the bottom left corner
It loads for a while, then says:
Current Location Not Available
Your current location cannot be determined at this time
When I open up system.log, I see the message:
SimulatorBridge[41185]: Selected location simulation scenario does not exist
I'm using Xcode 7.1.1 and the iPhone 6s / iOS 9.1 simulator. I've tried:
Setting a default location
Resetting the simulator in Simulator>Reset Content and Settings...
Reinstalling the simulator
but nothing seems to work. Anyone know what I might be doing wrong?
Ok, this may be a problem on Apple's end with Simulator for iOS 9.1.
I downloaded the iOS 9.0 simulator instead (Xcode>Preference>Downloads), fired up Maps in Simulator with the location set to Freeway Drive, and everything works -the location updates.
If you've had trouble simulating a moving location in your own app, just download and use a previous iOS Simulator version like above. Make sure you clean your project in Xcode first (Product>Clean), then rebuild it and everything should work fine.
I have enabled Background Modes > Location updates in my target's capabilites. I run the app in an iOS 9 simulator, I put the app in background state with Location > City run in the simulator, and it seems to keep getting location updates. But I run the app in a real iOS 9 device and few seconds after going to background, I loose the location services arrow in the status bar and no location updates are received.
On the other hand, I've run the app in a real iOS 8 device and it seems to keep listening for locations (the arrow in the status bar does not disappear).
Why are location services stopping in background in an iOS 9 real iPhone?
I need help to solve this, thanks in advance.
With iOS 9 you also need to set allowsBackgroundLocationUpdates to yes. See the docs here
I am on the latest version of XCode and using iOS 8. I have a scheme with a default location set and it seems to get stuck in the simulated location even on a device. I have tried, setting the location to "None" and unchecking the simulate box, and still on an iPhone 5 it keeps using New York, NY as the simulated location. Curiously, this doesn't happen on the iPhone 6. Any ideas?
Restarting the device seemed to clear this problem.
How do I simulate GPS movement on iOS simulator? I am developing an app that uses gps an I need to test it while the user location is changing.. How can I do that? thank you in advance..
From the Features > Location menu of the iOS Simulator, check the Location menu:
Note: The screenshot below is outdated, however the path above has been updated to reflect the proper menu location for this option.
It provides you with several options pertaining to changing the location of the simulated device.
For those that are getting here in 2020, things have changed a little bit,
You'll find the options to modify location settings under Features