How to connect to MIDI devices during development?

I'm porting some Mac MIDI code to iOS; it's an app that connects to external MIDI gear. The iOS app builds and runs, but I can't figure out how to debug it, since I can't simultaneously connect the iPhone to my Mac and to any devices. I've tried, but I can't jam the USB cable and the "Camera Kit" into the Lightning jack at the same time ;-)


Options I've tried are:

  • Run in the iOS simulator. Unfortunately no MIDI devices connected to my Mac are visible to the iOS app in the simulator. (I'm using devices with direct MIDI-over-USB connections, like the K-Board and the Novation Circuit, not an external MIDI-to-USB interface.)
  • The new wireless debugging support in Xcode 9. This would be perfect, if only it worked. I've got all the latest OS and Xcode betas installed, and I've checked the box to enable wireless debugging, but Xcode will not find my iPhone if it's not physically plugged in.
  • Investigate networked MIDI. This looks like it'd require a fair amount of knowledge and code to get working; there are some Objective-C classes and it looks like I also need to use NSNetService and run a Bonjour browser to find sessions. Nor is there any sample code I can find.


There are a number of iOS apps that support MIDI over the "Camera Connection Kit", so clearly it's possible to do this. Any advice?


—Jens

Replies

Try using MIDI over Bluetooth. It uses Core MIDI and you just need to pair it with your mac. You can use GarageBand on iOS to pair your iOS device with your Mac.