"External devices" are not what you want. Those are the things that a user can create in Audio MIDI Setup in OS X, to represent a synthesizer or keyboard or other device that is connected to the computer via a MIDI cable. The system does not automatically create them. (It can't, because MIDI is terribly primitive and has no device discovery protocol.)
External devices are only for the user's benefit in naming and arranging things. They can't be used to do MIDI input or output. They're especially useless in iOS, since there's no Audio MIDI Setup app.
Instead, use MIDIGetNumberOfSources
and MIDIGetSource
to find sources of MIDI data.
To actually get input, use MIDIInputPortCreate
to create an input port, then MIDIPortConnectSource
to connect one or more sources to that port. Then your port's MIDIReadProc
will be called when MIDI comes in.
Similarly, for output, you would use MIDIGetNumberOfDestinations
and MIDIGetDestination
to find destinations, create an output port using MIDIOutputPortCreate
, and MIDISend
to send data through a port to a destination.
For reference, see the MIDIServices documentation.