Search code examples
androiddebuggingandroid-studiolocationadb

Set GPS location in Android Studio while debugging app


(Preface: I have already seen this question, but it doesn't address setting the location while debugging the app. Opening "Android Device Monitor" closes the ADB connection to the debugger itself.)

I am trying to debug an application that monitors for location changes. The issue that I have is that I can't figure out how to run the debugger and set the location using adb geo fix ... at the same time.

I have tried running the command in the Android Studio "Debug" -> "Console" tab, but it doesn't seem to do anything.

How can I set the location while still remaining connected in the debugger?


Solution

  • In the end, I did this using Android GPS Emulator, a Java program which runs on the computer and sends location updates over ADB.