19

I'm working with Xcode 10.1 (10B61) on an app that needs permission to use the microphone. (Almost) Every time I start the app from Xcode (in simulator) I get a system popup:

"Appname" would like to access the microphone "Privacy - Microphone Usage Description"">

It doesn't matter if I select "Don't Allow" or "OK". This message keeps popping up. How can I fix it?

Update [fixed]

This issue seems to be fixed in Xcode 10.2

benrudhart
  • 1,406
  • 2
  • 13
  • 25
  • I'm having the same problem after updating to Xcode 10.1 (10B61). It's driving me batty. – cmilr Nov 23 '18 at 05:08
  • More specifically, the Simulator doesn't remember that you once granted access to these resources (not just the Microphone, but Photos, network, etc.) This is tedious. – jhhl Nov 29 '18 at 17:59
  • 1
    What is more concerning is if AdMob listening to the Microphone on the real device. Are they selling the captured audio to advertisement companies? – Houman Dec 28 '18 at 08:53
  • Possible duplicate of [Updated to Xcode 10.1 on Mojave and now my app always asks to use the microphone](https://stackoverflow.com/questions/53109911/updated-to-xcode-10-1-on-mojave-and-now-my-app-always-asks-to-use-the-microphone) – Cœur Jan 30 '19 at 06:19

4 Answers4

4

You can get rid of this following this steps:

  1. Go to "Security & Privacy" Settings on macOS.
  2. Select "Microphone" on the left panel.
  3. Uncheck the Xcode option on the right panel.
jherran
  • 3,337
  • 8
  • 37
  • 54
1

After looking for a workaround this one seems to fix it for me: In Simulator go to Settings > Your App > Disable the Microphone Access

Update: Not solving this issue but might be helpful: You can dismiss the popup via Esc key - that should be way faster than clicking a button

benrudhart
  • 1,406
  • 2
  • 13
  • 25
  • That isn’t in the Settings app for me (I am using iPad 2, since I still support iOS 9). – David Dunham Dec 18 '18 at 17:52
  • @DavidDunham I also had that issue once. Did you try deleting the app and or if that doesn't help reseting the simulator? – benrudhart Dec 19 '18 at 09:14
  • Xcode does not appear in the Microphone list on my macbook pro, macos 10.14.2. I fixed by not allowing the app access to the microphone, afterwhich the popup no longer appeared. This may not be an ideal fix but it worked so far. – Peter Suwara Jan 22 '19 at 23:52
1

Edit:

Unfortunately it looks like the following procedure is just a temporary fix. After some time the dialog started appearing again. Repeating the procedure fixes it for an additional period of time.


I had the same problem and what helped in my case was disabling and then re-enabling microphone permissions in the the Simulator.

Steps to fix:

  • go to Settings app in the Simulator
  • find your app settings page within the Settings app
  • disable microphone permission (or any other permission that is causing trouble)
  • re-enable microphone permissions

After this procedure, the microphone permissions dialog stopped appearing every time I would run the app.

Note that I did run the app with the permissions disabled and navigated to the point where permissions are required before re-enabling them (but I don't think that's required).

Hope this helps, it did in my case.

Community
  • 1
  • 1
Crt Gregoric
  • 392
  • 1
  • 5
  • 12
  • I haven't tried this, as what worked for me was just not allowing access to the microphone, then it stopped asking. As long as I allowed access, the app would request every time. But this does look like the correct solution, thanks. – Peter Suwara Jan 22 '19 at 23:54
  • My app's settings do not mention the microphone. Also, under settings->privacy-microphone no apps have requested access. – Tjalsma Mar 06 '19 at 19:18
  • Interesting, but you are requesting microphone access for your app? – Crt Gregoric Mar 07 '19 at 06:49
-3

Another work around is to check if the app is running in the simulator and disable the audio code:

struct Platform {
  static var isSimulator: Bool {
    return TARGET_OS_SIMULATOR != 0
  }
}
richy
  • 2,716
  • 1
  • 33
  • 42