Since yesterday my Xcode started to have no access to microphone.
Xcode: 11.5
MacOS: Catalina 10.15
This is confirmed with checking Mac "system preference" -> "security and privacy" -> "microphone". XCode is not listed there.
The problem: I don't know how to add Xcode back to the microphone permission list. Xcode does not prompt for this. I tried to reset Xcode. No success. I tried to manually uninstall it and reinstall it. No success. The manual unstall I did should remove everything. It includes:
- /Library/Preferences/com.apple.dt.Xcode.plist
- ~/Library/Caches/com.apple.dt.Xcode
- ~/Library/Developer
- ~/Library/MobileDevice
- ~/Library/Preferences/com.apple.dt.Xcode.plist
However, when I re-install Xcode, it is still the same. Xcode is not listed in microphone permission list and it does not promp for authorization either.
Anyone please help.
(background: I was working an IOS app where I record audio and play back the audio. It was working okay but yesterday it started to have problem with the AVAudioRecorder. When running simulator iPhone 11, it complains:
PropertyID=1667788144 is NULL
After some searching I pretty much nailed down it's because the app has no access to the microphone. I understand I need (1) Xcode has access to microphone and (2) the app has access to microphone.
Indeed when I check the Mac "system preference" -> "security and privacy" -> "microphone", I do not see Xcode is listed there. Moreover, my app indeed ask for microphone permisson with no problem. And that is confirmed with AVCaptureDevice.authorizationStatus(for: .audio). It is indeed "authorized". Therefore my only suspect is Xcode has no permission for microphone. This is the background. Please help. )