Turn off sound in iPhone Simulator

| | August 4, 2015

Is there an option to turn off sound, in iPhone Simulator?
Or to adjust volume?

5 Responses to “Turn off sound in iPhone Simulator”

  1. Simple solution.

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

    • Close the iOS Simulator.

    • Change the output source to the one you are not using (alt-click over
      the speaker in the top bar).

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

    • Change the output source to the one you are using and enjoy. The iOS
      simulator doesn’t update it’s output source when the system changes it.

  2. Cameron Lowell Palmer on November 30, -0001 @ 12:00 AM

    First Step – A sample video player

    I’m working on a solution to this problem and as a first step created a demonstration video player app. You can download VideoPlayer from GitHub for your own experiments.

    First Attempt – Use a 3rd party app to mute it

    Tried using Audio Hijack Pro by Rogue Amoeba to hijack the audio stream and mute it. This didn’t work and crashes the simulator. Contacted support and they reported that iPhone Simulator does some things that prevent them from hijacking the audio. I also looked into Soundflower and Jack.

    Second Attempt – In-app mute

    I was thinking maybe you could make a debug option where when in the app and on the simulator sound would be muted. However, within an app, only private APIs have the power to mute or reduce volume for the device. In the book iPhone Open Application Development Chapter 6, Example “What’s My Volume’ gives sample code for manipulating system-wide sound through the AVSystemController. It might be fun to explore this route, but to make it into a weaponized tool would require a lot of trouble since you need to compile against private headers.

    Idea Three

    Find a command-line option to pass to the Springboard or iPhone Simulator that will mute sound, or re-enable the volume control within the simulator, and of course be able to still launch the debugger.

    Sorta success

    The iPhone Simulator selects the currently selected output at launch. Using Soundflower plugin and sending the audio to nowhere I started the iPhone Simulator. If you then switch to a different, working, output the simulator will remain ‘muted’ until you restart the simulator.

    Enhancement Request

    I filed an Apple Bug Report enhancement request for both iPhone Simulator volume control, request 13428429, and per application volume control in Mac OS X, request 13428420. If you want these features, please file your own bug.

  3. referred from : iOS Simulator Sound

    Both the input and output device much match in system sound settings. Often u have them set to different devices. If they don’t match, the simulator seems to default to the last connected audio device selected among the input and output devices.

    I hope it helps out in any way.

  4. Pushpak Narasimhan on November 30, -0001 @ 12:00 AM
    [[MPMusicPlayerController applicationMusicPlayer] setVolume:0.0]; 

    This works for device, just give a try for simulator.
    How do you set the hardware volume in an iPhone app?

    You can even try the reverse of this thread to see. Sound not working in iPhone Simulator?

  5. You can use something like…

    #if DEBUG
       [ myAudioController setVolumen: .1 ];

    This way during testing, the app will have a lower volume.

Leave a Reply