Repeated request for microphone permission on iOS Simulator

断了今生、忘了曾经 提交于 2019-12-04 15:57:48

问题


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 👍


回答1:


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.



回答2:


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.




回答3:


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




回答4:


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
  }
}


来源:https://stackoverflow.com/questions/53432769/repeated-request-for-microphone-permission-on-ios-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!