5

I'm trying to test a GPS-enabled application and want to test it on the real device (not the emulator). I want to spoof the application by sending fake GPS coordinates to it.

I've read that you can do this with DDMS, but this does not work because the "Emulator Control" to send the GPS signal is greyed out (disabled). I tried:

  • Selecting the right device.
  • Running DDMS both in eclipse and outside from the command-line
  • I have enabled the Settings on my Android device so it allows USB debugging and GPS spoofing.
Roalt
  • 8,330
  • 7
  • 41
  • 53
  • please paste the code here for retriving gps coordinate – Pratik Dec 07 '11 at 12:50
  • @Pratik: It's not about receiving the GPS signal on Android, it's about sending a spoofed GPS coordinate to the device – Roalt Dec 07 '11 at 13:27
  • Same exact question. On the emulator, everything works fine and I can mock the location just fine (although it crashes when trying to use the system camera). I even tried restarting adb and then running DDMS from command line, based on this advice: http://stackoverflow.com/a/5059997/181284, but nothing worked. Pratik, it has nothing to do with the code itself, one should be able to spoof the location regardless of whether the app requests it correctly (which I'm sure it does in my case because the code has been tested by others). Btw, I'm trying this on a Samsung Galaxy Plus. – Neil Mar 26 '12 at 22:19

2 Answers2

1

Like I said in my comment, I have the same issue. The best workaround I've found so far is Motorola Dev Forums, which requires a bit of code to spoof locations on an actual device. However, like the OP pointed out to the ignorant Moto rep, the android docs do promise the ability to fake locations from the DDMS. I'll try coding the TestProvider tomorrow, and post updates here if I have any luck. Would appreciate it if you could do the same.

Neil
  • 3,100
  • 5
  • 29
  • 36
0

using mock location you do this. I have found some solution from this link may be this will help you check out this link

http://community.developer.motorola.com/t5/Android-App-Development-for/How-to-Send-Mock-Locations-with-DDMS-to-DROID-2-real-device/td-p/13720

Pratik
  • 30,639
  • 18
  • 84
  • 159