Debugging an iOS app with an external accessory connected via Dock
Asked Answered
B

4

30

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.

Bronwyn answered 6/8, 2010 at 2:51 Comment(1)
It is shameful that Apple still don't have wifi debugging for iOS (after seemingly trying to add it in a few times and then giving up). Double this with the fact that iOS 6.1 seems to have changed something fundamental in the runloop/input streams/EA framework and now my carefully written EA library no longer works. It would be insanely good to have a debugger right about now.Terat
E
20

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

Endsley answered 7/1, 2011 at 4:7 Comment(9)
Can you describe in detail how Wahoo Fitness accomplished this feat with the dockStubz product? We just tried it ourselves and the product does NOT allow simultaneous connection to the MFI and Laptop for Xcode debugging.Archibold
I am currently using Pete's solution to debug in xcode while having an accessory connected. The dockStubz is connected to the iPhone. A mini usb cable is connected from the dockStubz to the mac mini. This allows xcode to see the iPhone and an accessory can be plugged into the dockStubz.Entebbe
Also interesting to note that Xcode 4.2 allows debugging over Wi-Fi, though I have yet to get this to work..Bronwyn
@Entebbe - Do you use EA framework. Looks like this device doesn't work with EA framework.Hodgkinson
Does any one know if the "Wahoo Key for iPhone" is a slave device or actually has an OS?Hodgkinson
We would be receiving the dockStubz today from CableJive. Will report if it worked or not.Hodgkinson
Nope it doesn't work. 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.Hodgkinson
This kind of configuration only works for UART accessories (30 pin connector only) - the USB lines go to the Apple computer for debugging, the UART lines go to the accessory.Terat
Does not work for Audio / MIDI devices connected to the ipad /iphoneTurn
P
3

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.

Panfish answered 11/12, 2011 at 21:46 Comment(1)
This sounds interesting. How about some more details or links?Hodgkinson
B
2

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.

Bronwyn answered 17/11, 2010 at 13:33 Comment(0)
H
1

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

  1. So connect XCode mac using the male end into the USB slot of your computer. . Use a ethernet cable to connect this to a router.
  2. Connect the iPhone to the female part of the IO gear connector. Connect it to the router via ethernet cable.
  3. Connect the external accessory with the male connector (Sabrent USB to Fast Ethernet Network Adapter.) Connect it to router.

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.

Hodgkinson answered 11/12, 2011 at 1:28 Comment(1)
I am 99% sure the dockStubz solution only works for accessories which use UART as their iAP transport.Terat

© 2022 - 2024 — McMap. All rights reserved.