Stop the message "appName would like to access the microphone"

tl;dr don't need microphone access, not sure why system thinks I do, want to stop message from appearing with each simulator launch.


I recently upgraded our dev machine to Mojave. I waited because I didn't want any unexpected surprises with our project to delay us. Unfortunately I ran into one problem that is driving me crazy. Every time I launch my app in the simulator the mac asks me "(appName) would like to access the microphone." with an "Allow" or "Cancel" button. My app has no intentional microphone access. (Note: My app does ask for photo album access but I am not sure why that would be relevant.)


In any case, I would like to disable this dialog in any way possible. Any of the following are accetable to me.

1. Removing offending code when run in the simulator (but like I said I don't know what is causing it).

2. Some way of whitelisting my app?

3. Some change to the system settings to prevent the dialog from appearing.


Please help!!


MacOS: 10.14

XCode: 10.1

Replies

I have this problem, too.

Same here 🏼

Me too

I am also seeing this problem. I am playing a video with the sound off but I am not attempting to record anything. XCode 10.1

Same here.

But for me that permissions dialog only pops up when I run tests in the simulator, making the tests containing video playback fail. It doesn't show up when debugging.

It was driving me crazy too and I found the setting, where you can turn it off!


1. Go to "Security & Privacy" Settings on macOS

2. Select "Microphone" on the left panel

3. On the right panel disable the option for Xcode

Hi,


I found a way to solve this crazy thing.
Launch your app on the simulator not from xcode, but directly from the app's icon.
Then answer the question for the last time, it won't appear again.


Alleluia!


🙂

I found that none of the above helps, because every time I build my app in XCode for the simulator and run it, it will ask for the microphone access permission. I think this is a major oversight on Apple's part:

1. My app does not use the microphone, it only plays back, still, the alert is triggered. If anybody knows a way to completely disable audio input for the app please post it.

2. There must be some "official" workaround for this, since it is highly annoying for anybody developing audio apps on Mojave.

I second this, I've tried all kinds of tricks and suggestion, including others that I came up with, without much luck.

I have the same problem... this is very upsetting me. Apple please help... I have last month many apps with audio thinks... and that message appears all the time after I rebuilding the code. And I didn't find any solution

this not helping if you will add even one empty line to your code - the message will appear again and again.... and then again and again...

One answer above was to turn off the Xcode ability to use the Microphone. I am finding that if I turn Xcode access to the Microphone ON, I no longer get buzzed with the permission request sheet.


However, this still begs the question - my app does not require the microphone - so why is it being requested. Anyway, a workaround for now.


In macOS system prefs, go to Security & Privacy > select the Privacy tag > scroll to microphone > allow Xcode permission.

I think I found a workaround. Please try this.


1. Make an alias of Simulator.app. (You can find it in Xcode.app contents. or just "Show in Finder")

2. Copy and paste it to /Applications

3. Go to pref Security & Privacy > Privacy tag > full disk access, and add Simulator.app

There seems to be two issues here: microphone access for both Xcode and the app itself.


Your app (or a UITest) can prompt (fail) for either or both, though not always on same run.


Both of these dialogs must be approved to allow access, after which the permission persists between Xcode and Simulator resets or restarts.


You can confirm access has been approved for Xcode in System Preferences -> Security & Privacy-> Microphone, where you should see the Xcode in the UI.


The app itself, approved or not, won't appear in the UI here, however.


If you are unsure it the app has been approved, reset all the microphone permissions with 'tccutil reset Microphone' in the Terminal, and re-run your app/test, until both dialogs have been shown and approved.

This issue is especially a problem when doing automated UI tests with XCTest. When using AVPlayer within tvOS, any time a video is attempted to be played, this popup comes and the app controls lose focus. The video player will not play a video (it just shows a black screen) and controls behave unpredictably (i.e. no control has focus in the tvOS app and/or clicking .select on the remote button has no effect) unless the macOS acknowledges this popup, which is obviously a pain for development, but more importantly, totally impossible when the tests are run on xcode server unattended.