问题
I'm writing a Swift library which in turn uses the AudioKit library as a dependency. When using AudioKit in iOS, you'll have to enable 'Background Mode' in the capabilities section in project settings. But when running iOS tests, there's no place for such configuration and as a result you're confronted with this error:
CheckError Error: kMIDINotPermitted: Have you enabled the audio background mode > in your ios app?
I tried adding the corresponding "Required background modes" entry to the plist file for both the library and the test file to no avail. Perhaps the testing code for AudioKit can shed some light? Thanks.
回答1:
I found the solution:
Enable background audio in the "Capabilities" tab for your project, under "Background Modes."
Reference
来源:https://stackoverflow.com/questions/46900535/background-mode-is-not-enabled-in-ios-tests