iPhone 模拟器提供位置结果

发布于 2024-10-18 10:57:00 字数 758 浏览 5 评论 0原文

我正在使用 iOS SDK 4.2 并遵循本教程: http://mobileorchard.com/hello -there-a-corelocation-tutorial/,并在使用 iPhone 和 iPad 的控制台上获取了一些 GPS 日志。

然后我在模拟器上运行它来测试其他功能,CoreLocation 日志命中了 locationManager:didFailWithError: 方法,这是公平的,因为 MacBookPro (OSX 10.6.6) 没有 GPS 功能......或者我是这么认为的。

今天早上,我在工作时而不是在家里再次在 iPad 上进行了测试,现在在没有连接任何设备的情况下在 iPhone 模拟器上进行测试,模拟器提供了我办公室的位置结果(不,我不在库比蒂诺工作)和水平精度每次在45-56m之间变化,最多只给出两个样本(大概是因为我的笔记本没有移动)。

现在我已经完全关闭了 XCode 和模拟器,并从模拟器中删除了应用程序,并执行了清理和重建,但仍然得到了我当前的坐标。我也可以在没有互联网接入的情况下复制它,以防模拟器对某种 GeoIP 很棘手。

模拟器从哪里获取我的位置?

我想,当我今天早上使用 iPad 时,模拟器可能存储了一些 GPS 位置数据,但没有连接设备并干净地启动所有内容,它提供了不同的结果,例如 + // 0.000001 度数变化。

I am using iOS SDK 4.2 and followed this tutorial: http://mobileorchard.com/hello-there-a-corelocation-tutorial/, and got some GPS logs happening on the console using both iPhone and iPad.

Then I ran it on the simulator to test other features and the CoreLocation logs were hitting the locationManager:didFailWithError: method which is fair because the MacBookPro (OSX 10.6.6) has no GPS functionality... or so I thought.

This morning I tested it on the iPad again at work instead of at home and now testing on the iPhone simulator without any device connected the simulator is providing my location results of my office (No I don't work in Cupertino) and the horizontal accuracy is varying between 45-56m each time and only giving two samples at most (presumably because my notebook isn't moving).

Now I have fully closed XCode and the simulator and deleted the app from the simulator and performed a clean and rebuild and still getting my current coordinate. I can also replicate it without internet access incase the simulator was being tricky with some sort of GeoIP.

Where is the simulator getting my location from?

I thought perhaps maybe the simulator stored some GPS location data when I used the iPad this morning but with no device connected and clean starting everything it is providing varying results eg +/- 0.000001 of a degree variations.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦晓ヶ微光ヅ倾城 2024-10-25 10:57:00

来自 MacBook 的 IP 地址,或者如果使用 WiFi,则来自 WiFi 网络的存储位置。因为它对你来说非常准确,所以它就是 WiFi,因为 IP 地址方法通常将其范围缩小到一个城市,或者最多是一个城市的一部分。

Skyhook 提供美国和其他一些地区的大多数 WiFi 网络的地理位置信息Apple 订阅的世界信息。


编辑添加

显然苹果去年四月放弃了 Skyhook,现在使用自己的数据库,但系统是一样的。就像谷歌在德国陷入困境一样,有人开着电脑到处寻找 WiFi 网络并记录他们的位置。

From your MacBook's IP address or, if it's on WiFi, the stored location of your WiFi network. Since it's so accurate for you, it's the WiFi, since the IP address method generally narrows it only to a city, or at best, part of a city.

Skyhook provides geolocation information for most of the WiFi networks in the US and some other parts of the world, info that Apple subscribes to.


Edited to add

Apparently Apple ditched Skyhook last April and now uses its own database, but the system is the same. Much like Google got in hot water for in Germany, someone drives around with a computer looking for WiFi networks and recording their location.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文