Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 384
Moshe Katz Avatar asked Mar 18 '23 07:03

Moshe Katz


2 Answers

1- go to plugins and look for GPS emulator, and install it then start the emulator from Tools--> Android---> Android device monitor then find you desired location long and lat (search google for any website that gives you the lang lat for your city, google: get lang lat websites) and send them to the android emulator.

2- or fastes way if android emulator is running On the Right Side of Your Android Emulator Where (Power Button ,Speaker , Camera etc Sign are given Find Three Dot Sign(...) at the last of that column. click on that then Click on location and Set the Latitude and longitude

enter image description here

like image 50
Ridha Rezzag Avatar answered Mar 31 '23 15:03

Ridha Rezzag


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

like image 24
Moshe Katz Avatar answered Mar 31 '23 14:03

Moshe Katz