> For the complete documentation index, see [llms.txt](https://docs.drizz.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.drizz.dev/different-use-cases-supported-by-drizz/how-to-use-location.md).

# How to Use Location

Testing location-based features is critical for applications that rely on GPS or geolocation services. Drizz AI provides versatile methods to simulate and test such features effectively during your testing sessions.

### **Setting Location Using Commands**

The **SET\_GPS** command allows you to update the emulator's location dynamically. Depending on whether you're working with the current app or switching to a new one, follow these guidelines for proper command execution.

#### **Scenario 1: Updating Location for the Existing App**

If you want to use the **SET\_GPS** command for the currently running app:

**Kill the App:** Use the **KILL\_APP** command to stop the current app.

KILL\_APP

1. **Set the GPS Location:**

| SET\_GPS(latitude=12.9763, longitude=77.5929) |
| --------------------------------------------- |

1. **Reopen the App:** Use the **OPEN\_APP** command to launch the app again with the updated location.\
   OPEN\_APP:(com.deliveryapp)
2. **Validate the Behavior:** Confirm that the app reflects the updated location appropriately.<br>

#### **Scenario 2: Using Location for a Different App**

If you need to test location functionality for another app:

**Set the GPS Location:**

| SET\_GPS(latitude=28.7041, longitude=77.1025) |
| --------------------------------------------- |

**Switch to the Other App:**\
Use the **OPEN\_APP** command to launch the second app.<br>

| OPEN\_APP:(com.mapapp) |
| ---------------------- |

**Validate the Behavior:** Ensure the new app reflects the updated location.<br>

### **Emulator’s Location Button**

Alternatively, you can manually update the location using the **Location Button** in the emulator's side panel.

**Steps:**

1. Pause the test session.
2. Open the emulator’s side panel.
3. Select the **Location** button.
4. Enter the desired latitude and longitude values.
5. Resume the test session and verify the app’s response.

### Location Testing Tips

1. **Dynamic GPS Updates:** Use the **SET\_GPS** command for automated, precise location changes during tests.
2. **Kill and Relaunch for Consistency:** Always restart the app after updating the location to ensure it reloads with the new GPS data.
3. **Switch Apps Seamlessly:** Combine **SET\_GPS** and **OPEN\_APP** commands to test multi-app workflows efficiently.
4. **Manual Adjustments for Debugging:** Leverage the emulator’s side panel for quick location updates during exploratory testing.

By following these methods, you can confidently test and validate location-sensitive features in various scenarios, ensuring robust app performance across geographic contexts.
