Turn off the sound in iPhone Simulator

Is there an option to mute the iPhone Simulator ? Or adjust the volume?

+53
ios objective-c xcode ios-simulator macos
Jul 07 2018-10-07T00:
source share
8 answers

Partial success - no good options

IPhone Simulator selects the currently selected output at startup. Using the Soundflower plugin and sending audio to nowhere, I started using iPhone Simulator. If you then switch to another, working, output, the simulator will remain “disabled” until you restart the simulator. Thus, in general, you can try to trick the simulator to bring it to a dead end.

Experimental setup - sample video player

I am working on a solution to this problem, and as a first step a demo video player was created. You can download VideoPlayer from GitHub for your own experiments.

First try. Use a third-party application to disable it.

Tried using Rogue Amoeba's Audio Hijack Pro to grab the audio stream and mute it. This did not work and the simulator worked. Contact support, and they reported that the iPhone Simulator does some things that prevent them from capturing audio. I also reviewed Soundflower and Jack .

The second attempt is to disable the application

I thought maybe you can make a debugging option when the sound is turned off in the application and on the simulator. However, in the application only private APIs have the ability to disable or reduce the volume for the device. In the iPhone Open Application Development book, Chapter 6, “What is my volume” example, provides sample code for managing system-wide sound through AVSystemController. be interesting for exploring this route, but turning it into a weapon tool will require a lot of trouble since you need to compile it with closed headers.

Idea three

Find the command line parameter to go to the Springboard or iPhone simulator, which will turn off the sound or turn on the volume control in the simulator again and, of course, can start the debugger.

Request for improvement

I filed an Apple bug report to improve iPhone Simulator volume control, request 13428429 and to control application volume on Mac OS X, request 13428420. If you need these features, write your own bug.

+21
Mar 10 '13 at 18:03
source share
— -

You can use something like ...

 #if DEBUG [ myAudioController setVolume: .1 ]; #endif 

Thus, when testing the application will have a lower volume.

+4
Sep 02 '11 at 18:14
source share

Open iOS Simulator, click on Hardware> Volume Down (⌘ ↓) until it turns off! I think it was added in Xcode 9.2 and is only available when running sim with iOS 11 and above

+4
Dec 21 '17 at 10:21
source share

Link: iOS Simulator Sound

Both input and output devices are very similar in the sound settings of the system. Often they have them installed on different devices. If they do not match, the simulator apparently uses the last connected audio device selected among the input and output devices by default.

I hope this helps anyway.

+1
Mar 12 '13 at 12:35
source share
 [[MPMusicPlayerController applicationMusicPlayer] setVolume:0.0]; 

This works for the device, just try the simulator. How to install a hardware volume in an iPhone application?

You can even try the other side of this stream. Sound does not work in iPhone Simulator?

0
Mar 10 '13 at 14:10
source share

1) Download the Loopback app

2) In Loopback, create a new virtual audio device (click " New virtual device ). Rename it if you want (I called it Blackhole ).

3) In the simulator, select " Hardware > Audio output and select the name of the created virtual audio device.

Loopback

iOS Simulator

0
Jun 17 '18 at 2:36
source share

In my case, I just set the audio output somewhere that is disabled. Like my external screen :)

0
Dec 04 '18 at 12:25
source share

A simple solution.

  • Make sure you have 2 outputs in your mac. For example, if speakers and headphones.

  • Close the iOS simulator.

  • Change the output source to the one you are not using (press Alt speaker in the top panel).

  • Run the iOS simulator again. It will use the default output source.
    to one in the system.

  • Change the output source to the one you use and enjoy. The iOS simulator does not update the output source when the system changes it.

-one
Aug 04 '15 at 19:47
source share



All Articles