使用通过 Dock 连接的外部配件调试 iOS 应用程序
我是否遗漏了一些明显的东西,或者是否无法调试使用通过 30 针底座连接的外部配件而不使用大量日志等的 iOS 应用程序。我希望能够使用诸如断点和仪器仪表。
有没有办法通过 Wi-Fi、蓝牙进行远程调试?
注意:是的,我最近问过这个问题,然后我删除了它,因为我认为我找到了答案。但答案是只有 Instruments 支持 Wi-Fi。而不是 Xcode 调试。所以问题仍然存在......
所以......:鉴于我没有真正幸运地找到答案,而且还没有人给我答案 - 我认为它是个大胖NO。 :(
让我想知道我们是否只是希望神奇地猜测错误发生的地方,或者通过在设备和配件之间不断地来回移动我们的底座连接器来磨损我们的底座连接器,从而从所有东西中记录下来?
我想是时候提交错误报告了。
Am I missing something glaringly obvious or is there no way to debug an iOS app which uses an external accessory that's connected via the 30-pin dock without using a bucket load of logs etc. I want to be able to use things such as breakpoints and Instruments.
Is there a way to remote debug perhaps, over Wi-Fi, Bluetooth?
Note: Yes, I asked this very recently and I deleted it because I thought I found the answer.. but the answer was only Instruments has support over Wi-Fi.. not Xcode debugging. So the question still remains...
And so...: Given that I've had no real luck finding the answer, and no one has given me an answer as yet - I take it that it is a big fat NO. :(
Makes me wonder are we just expected to magically guess where bugs occur, or log the crap out of everything while wearing out our dock connectors by continuously moving it back and forth between the device and accessory?
Time to file a bug report I guess.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在今天的 CES 上,我与 Wahoo Fitness 的一位开发人员进行了交谈,该开发人员为 iPhone 制作 ANT+ 配件。他们也遇到了同样的问题,但找到了解决方案。
他们发现了一个带有迷你 USB 端口的直通底座扩展器。他们在连接配件时使用迷你 USB 端口进行调试。
他们使用的产品是 http://www.cablejive.com/products/dockStubz.html
此博客讨论远程调试 iOS附有底座配件
At CES today, I talked to a developer from Wahoo Fitness that makes an ANT+ accessory for iPhone. They had this same problem, but found a solution.
They found a pass-through dock extender that has a mini-USB port. They used the mini-USB port for debugging while the accessory was connected.
The product they were using is http://www.cablejive.com/products/dockStubz.html
This blog talks about remote debugging iOS with a dock accessory attached
您可以将外部配件连接到另一台 iOS 设备(而不是连接到运行 Xcode 调试器的 Mac 的设备)。然后通过一对 wifi 套接字将所有 EA 框架消息从附件连接的设备传输到运行正在调试的应用程序的设备。查看将加速度计消息从设备传输到 iOS 模拟器的代码(在模拟器上调试游戏代码的常见技巧),了解如何完成此操作的示例。
You could connect the external accessory to another iOS device (not the one tethered to the Mac running the Xcode debugger). Then tunnel all your EA framework messages from the accessory connected device to the device running the app being debugged over a pair of wifi sockets. Look at the code for tunneling accelerometer messages from a device to the iOS Simulator (a common trick for debugging game code on the Simulator) for one example of how this could be done.
经过进一步研究,并发现人们必须通过 Wi-Fi 发送字符串才能解决这个问题,我的结论是答案是否定的。
我已为此提交了错误请求。
与此同时,Wi-Fi 日志记录和设备上的文本日志记录似乎将是目前的解决方案。
After further researching, and having seen that people had to do sending strings over Wi-Fi to get around this, I'm concluding the answer is no.
I have filed a bug request for this.
In the mean time, it seems like the Wi-Fi logging, and on-device text logging will be the way to go for now.
以下是我对为什么 USB 协议适用于某些外部配件而不适用于其他外部配件的理解。看起来像一个基本问题,如果没有仲裁器,两个主设备无法通过 USB(串行主/从协议)与单个从设备通信。所以 XCode 是一个主设备,iPhone 是从设备。如果外部配件也是主设备,则无法将 iPhone(Xcode 从设备)连接到第二个主设备(外部配件)。
可能“Wahoo Key for iPhone”是一个从属设备,这就是为什么dockStubz解决方案适用于此类外部配件。
我已经测试了dockStubz。它不适用于我的外部配件。正如怀疑的那样,USB协议不能被使用过去有两个主设备控制一个从设备尝试将 Mac(主设备)(通过迷你 USB)和外部配件(主设备)(通过 30 针连接器)连接到 iPhone 4(从设备)。 iPhone 进入连接和重新连接的循环,
虽然价格昂贵,但看起来也很有希望:digi.com/support/kbase/kbaseresultdetl.jsp?id=485
。路由器将来自两个主设备(XCode 和外部附件)的请求路由到从设备(iPhone)?我要去百思买购买 USB 到以太网电缆并将所有三个连接到我的 IP 路由器将报告它是否有效。
这就是所需要的:
http://www.bestbuy.com/site/IOGEAR+-+USB+Ethernet+Extender/9614781.p?id=1218131339965&skuId=9614781&st=USB%20to%20Ethernet& ;cp=1&lp=1
http://www.frys.com/product/6103339
我仍在研究这是否有效。刚刚订购了零件。将在周五和周五之前收到。届时会报告。
更新:
IOGear 公端连接到路由器时消耗过多电流。另外,母头连接路由器后,即使提供5V USB电流,也无法给iPhone充电。
于是尝试将iPhone直接连接到路由器的USB插槽(用于打印机)。它确实可以为 iPhone 充电。还使用 USB 到快速以太网网络适配器(BestBuy 有一个通过 USB 连接 Wii)将 Mac 连接到路由器。它确实连接到互联网,但找不到 iPhone。在路由器客户端列表中,我没有看到任何 iPhone 的登录完整信息。所以这个实验是失败的,除非有人有其他指示。
Here's my understanding for why just the USB protocol works for some external accessories and doesn't for other external accessories. Looks like a fundamental problem, without an arbitrator, two masters can't talk to a single slave over USB, a serial Master/Slave protocol. So XCode is one master, the iPhone is the slave device. If the external accessory is a master too, one won't be able to connect the iPhone (Xcode slave) to the second master (the external accessory).
Probably the Wahoo Key for iPhone" is a slave device and that's why the dockStubz solution works for such an external accessory.
I have tested the dockStubz. It doesn't work for my external accessory. As suspected, the USB protocol can't be used to have two Master devices controlling a single slave device. Trying to hook up a Mac (Master) (via the mini USB ) & an external accessory (Master) (via the 30 pin connector) to the iPhone 4 (Slave) causes the iPhone to go in loop of connect & re-connect.
Following looks promising too, though expensive: digi.com/support/kbase/kbaseresultdetl.jsp?id=485.
Has any one tried to use USB to Ethernet connectors and use a router to route requests from two masters (XCode & External Accessory) to the slave (iPhone)? I am off to Best Buy to purchase USB to Ethernet cables and hook all three on to my IP router. Will report if it works.
This is what will be needed :
http://www.bestbuy.com/site/IOGEAR+-+USB+Ethernet+Extender/9614781.p?id=1218131339965&skuId=9614781&st=USB%20to%20Ethernet&cp=1&lp=1
http://www.frys.com/product/6103339
I am still researching if this will work. Just ordered the parts. Will get it by Friday & will report back then.
Update:
The IOGear male end draws too much current when connected to router. Also, the female end can't charge iPhone when connected to the router even when 5V USB current supplied.
So tried to directly connect the iPhone to the USB slot of the router (used for printers). It does charge the iPhone. Also used USB to Fast Ethernet Network Adapter (BestBuy had one to connect Wii via USB) to connect the Mac to the router. It did connect to internet but couldn't find the iPhone. In the router client list I don't see any login entires for the iPhone. So this experiment was a failure unless someone have other pointers.