Missed the action at the 2018 Chrome Dev Summit? Catch up with our playlist on the Google Chrome Developers channel on YouTube. Watch now.

Emulate Sensors: Geolocation and Accelerometer

GPS chips and accelerometers can be difficult to test since most desktops don't have them. The Chrome DevTools Sensors emulation pane reduces the overhead of testing by emulating common mobile device sensors.


  • Emulate geolocation coordinates to test geolocation overrides.
  • Simulate device orientation to test accelerometer data.

Access sensor controls

To access the Chrome DevTools sensor controls:

  1. Open the DevTools main menu, then
  2. Under More Tools, click on Sensors
Navigate to Sensors panel

Override geolocation data

Unlike desktops, mobile devices commonly use GPS hardware to detect location. In the Sensors pane, you can simulate geolocation coordinates to use with the Geolocation API.

Enable the geolocation emulation by selecting the Emulate geolocation coordinates checkbox in the sensors pane of the emulation drawer.

geolocation emulator enabled

You can use this emulator to override position values for navigator.geolocation, as well as to simulate cases when geolocation data is unavailable.

Emulate Accelerometer (Device Orientation)

To test accelerometer data coming from the Orientation API, enable the accelerometer emulator by selecting the Accelerometer checkbox in the Sensors pane.

Accelerometer control

You can manipulate the following orientation parameters:

Rotation around the z-axis.
Left-to-right tilt.
Front-to-back tilt.

You can also click and drag the model accelerometer to the desired orientation.

Try out the accelerometer emulator using this device orientation demo.


Was this page helpful?