Recently I installed Xcode11 and tried my working music application on iOS13 simulator. But unfortunately I faced an unexpected runtime error message “Couldn’t find MIDI network driver” and crash!
I was using last update of AudioKit 4.9 (as I updated it at the same time with Xcode 11) I thought that could be the problem. But not!
I checked on this issue and found the related StackOverflow post that is pointing the problem as iOS13 Simulators problem. So it is not related to AudioKit.
This problem resolved by Evan Muray ‘s method. Copying the existing network drivers to the correct place.
Explained in AudioKit issue section.
I put a copy of the procedure also credit Evan Muray.
- Update Xcode to the latest version (if there is an update available)
- Make sure your build target deployment version is set to iOS 13.0 (yours most likely is since you were using the iOS 13 simulator)
- Quit the applications Simulator and Xcode if they are open
- Open Finder
- Navigate to the folder which your version of Xcode is located (mine is in my Applications folder)
- Find Xcode
- Hold down the control button on your keyboard and click on Xcode
- A menu should pop up, select ‘Show Package Contents’
- You should see the folder called ‘Contents’ now open it
- You should now see a variety of folders. Follow the directory path below to find the MIDI network drivers
- Navigate to /Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime
- Repeat step 7 but this time, click on the file ‘iOS.simruntime’
- Open the ‘Contents’ folder inside of the ‘iOS.simruntime’
- Open the folder called ‘MacOS’
- You should see a document called ‘iOS 13.0’
- If you see this, congrats, you are in the right Simulator folder!
- Exit out of the ‘MacOS’ folder back to the ‘Contents’ folder and Navigate to /Resources/RuntimeRoot/System/Library/Audio/MIDI Drivers
- In this folder, you should see all of the MIDI network drivers which Xcode is missing.
- If step 15 is true, exit out of the ‘MIDI Drivers’ folder back into the ‘Audio’ folder
- Copy the whole ‘MIDI Drivers’ folder by selecting it and using (Command + C) or Edit -> Copy “MIDI Drivers”, whichever you prefer
- Exit out of the ‘Audio’ folder and navigate all the way back to the ‘RuntimeRoot’ folder
- Navigate to /Library/Audio and you should see there is no folder called ‘MIDI Drivers’ here, only ‘Plug-Ins’ and ‘Tunings’
- You want to Paste the ‘MIDI Drivers’ folder you copied into this ‘Audio’ folder, use (Command + V) or Edit -> Paste Item
- Now you should have two ‘MIDI Drivers’ folders: One in /System/Library/Audio and One in /Library/Audio
- Close Finder and relaunch Xcode and try running your project again in the iOS 13 iPhone simulator
Now, Xcode should not complain about missing the MIDI Drivers, and your code should run without the EXE_BAD_ACCESS!