Android testing basics

How to test an Android mock location

Plan a location test, check the result, and return your test device to normal. This guide covers Android basics and the LeapWay Windows setup.

Windows + AndroidUSB connectionUse an authorized test device
01

What is a mock location?

A way to exercise location-dependent behavior without traveling.

Android offers a developer setting to select a mock location app for testing. A test location can help you check an app's behavior in another place, but individual apps may handle simulated locations differently. Test only apps and devices you own or are authorized to test.

See Android's Developer options documentation for the platform setting.

02

Prepare your test

Use a trusted computer and a device you can change settings on.

  • A Windows PC, an unlocked Android test device, and a USB cable that supports data.
  • A test app you are authorized to use, with location permission configured for the test.
  • A known test location and an expected result to compare against.
  • Time to restore and verify normal location behavior after the test.
Compatibility

A verified Android device and version list is not currently published. The current LeapWay desktop interface is in Simplified Chinese; Android menus also vary by device.

03

Connect, test, and verify

Keep the Android device unlocked during initial setup.

  1. 1

    Connect the device

    Install and open LeapWay on Windows, then connect the phone with a data-capable USB cable. Follow the step-by-step setup guide to enable USB debugging and approve the prompt on the phone.

  2. 2

    Complete Android setup

    Follow the desktop client's instructions for its Android companion and requested permissions. If your setup asks you to select a mock location app, use the device's Developer options and follow the instructions shown on your device.

  3. 3

    Choose a location and check it

    Choose a test point on the desktop map. On the device, check the location in a trusted location app, then exercise the location-dependent feature in the app you are testing. Compare what you observe with your expected result.

  4. 4

    Record the outcome

    Note the device model, Android version, test point, expected result, and actual result. If the result differs, check permissions and setup messages; app behavior and compatibility can vary.

Connection trouble?

Check the cable, authorization prompt, and Windows device recognition in the setup troubleshooting section.

04

Finish the test safely

Disconnecting the cable alone may not restore normal location behavior.

  1. 1

    Stop the active test

    Stop the active location test in LeapWay, then disconnect the device.

  2. 2

    Verify normal location

    Check a trusted location app. If the result still appears changed, restart the affected app or device and review Android's mock-location setting. Menu names vary by device.

  3. 3

    Disable debugging when finished

    Turn off USB debugging when you no longer need it. Only authorize computers you trust.

Next step

Prepare your Android device

Review the connection checklist and troubleshooting steps before beginning.

Read the setup guide