Is it possible record the actual sound on the simulator using the mic.
I have created the recorder which record the sound in simulator but not recording the actual audio its just null(empty) audio.

- 9,095
- 5
- 44
- 56
2 Answers
The old answer for this question is now incorrect; the iOS Simulator now supports audio input/recording.
Pic below related: where you set your audio input device (defaults to your system default)
Also be warned, some online Apple dev docs still say audio input is unsupported by the simulator ("as of 8.2") even though it is with newer versions...
Edit: Screenshot from OS X 10.12 (Sierra), Xcode 9.1 (function is also available in later Xcode 8, > 8.2)

- 400
- 5
- 15
-
Hmm really interesting, but I don't have this on my Simulator, can you tell me more with the sim/xcode version ? Some features (catching video via the ```xcrun simctl``` command line) require that you Mac runs the "Metal" API, is this about my issue ? – tontonCD Nov 20 '17 at 14:03
-
1Added version info above, screenshot from OS X 10.12 (Sierra), Xcode 9.1 (function is also available in later Xcode 8, > 8.2). Metal is a graphics API so it is likely not the issue if you can't access your internal mic via simulator. What version OS X/ Xcode are you on? – mix0lydian Nov 21 '17 at 14:48
-
Thanks; strangely my OS X is 10.13.1 (High Sierra) but my Xcode 8.2 (8C38), with nothing to update in the App Store application... perhaps I'm restricted to the french store ? – tontonCD Nov 29 '17 at 13:25
-
- I'd found this restriction : https://stackoverflow.com/questions/41240133/ios-simulator-video-recording-with-xcrun-simct-give-error, "Video recording is only supported on Macs that support **Metal**", my iMac is not in the models that support Metal (https://support.apple.com/en-us/HT205073) - as I mentioned supra, I use SoundFlower now, it works fine – tontonCD Nov 29 '17 at 13:32
-
@tontonCD can you advise me on your configuration, can you get audio to work with `xcrun simctl` ? – Jules Feb 05 '18 at 20:48
-
This is a feature of Xcode 9+ in combination with iOS 11+. – russbishop Feb 19 '18 at 21:01
-
`AVCaptureSession` fails to initialize with this – Neil Galiaskarov Apr 19 '18 at 16:21
-
I'm using Mac M1 && Xcode Version 12.5 (12E262), sound is not recorded on simulator, even try commad line still no sound, what a pity. – Zhou Haibo Jun 09 '21 at 08:36
iOS Simulator does not support audio recording, you should use real device to test.
Here you can read about Limitations of Testing in iOS Simulator
Hardware Limitations While most of the functionality of iOS devices can be simulated in iOS Simulator, there are some hardware features that must be tested directly on a device. The hardware features that cannot be simulated are:
Accelerometer
Gyroscope
Camera
Proximity SensorMicrophone Input
-
Oh what a drag, i really like if simulator do that. but anyways thanx for reply and link.+1 – Dilip Manek Nov 20 '13 at 07:52
-
5It works fine for me using AVAudioRecorder with earphones in the physical line-in port – Hamzah Malik Oct 12 '15 at 19:05
-
1It works for me on MacBook air. I am able to record sound using simulator. – krawiec Jul 06 '16 at 10:26
-
It's WRONG, take a better look to the limitations specs: it's talking about the simulation of *real devices*. Simulation if, for example GPS, give a fix location. The Simulator does make sounds. Catching them is a bit more difficult, I use SoundFlower. Not immediate to configure but it works. – tontonCD Nov 20 '17 at 13:58
-
I've not managed this so far, I've also installed soundflower, but I get no sound when using `xcrun simctl` ?? – Jules Feb 05 '18 at 20:33
-
iOS 13 with Xcode 11: I just pulled out all of my simulator specific code paths and compiler directives around my audio code and recording just works. Still throws exceptions, so it will pause if you have an "all exceptions" breakpoint set. But you can continue and recording will start. However, it's always a good idea to test on actual devices. – Scott Ahten Mar 12 '20 at 21:52