仿真器控制在真实 Android 设备上被禁用
我正在尝试测试支持 GPS 的应用程序,并希望在真实设备(而不是模拟器)上测试它。我想通过向应用程序发送虚假 GPS 坐标来欺骗该应用程序。
我读过您可以使用 DDMS 执行此操作,但这不起作用,因为发送 GPS 信号的“模拟器控制”呈灰色(禁用)。我尝试过:
- 选择正确的设备。
- 在 Eclipse 中和外部命令行中运行 DDMS
- 我已启用 Android 设备上的设置,因此它允许 USB 调试和 GPS 欺骗。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如我在评论中所说,我也有同样的问题。到目前为止我发现的最好的解决方法是 摩托罗拉开发论坛,这需要一些代码来欺骗实际位置 设备。然而,就像 OP 向无知的 Moto 代表指出的那样,Android 文档确实承诺能够从 DDMS 伪造位置。明天我将尝试对 TestProvider 进行编码,如果运气好的话,我会在这里发布更新。如果您也能这样做,我将不胜感激。
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.
使用模拟位置你可以做到这一点。我从此链接找到了一些解决方案,这可能会帮助您查看此链接
http://community.developer.motorola.com/t5/Android-App-Development-for/How-to-Send-Mock-Locations-with-DDMS-to-DROID-2-real-设备/td-p/13720
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