Skip to main content
Control iPhone hardware buttons including volume and the Action button.

Volume Control

Adjust the device volume:
# Increase volume
phone.volume_up()

# Decrease volume
phone.volume_down()
Each call adjusts the volume by one step.

Adjust by Multiple Steps

# Increase volume by 5 steps
for _ in range(5):
    phone.volume_up()
    time.sleep(0.1)

# Decrease to minimum
for _ in range(16):  # iOS typically has 16 volume steps
    phone.volume_down()
    time.sleep(0.1)

Action Button

Press the Action button (iPhone 15 Pro and later):
phone.action_button()
The Action button’s behavior depends on user settings - it might:
  • Toggle silent mode
  • Open the camera
  • Start a voice memo
  • Run a shortcut
  • And more
The Action button is only available on iPhone 15 Pro models and later. Calling this on older devices will have no effect.

Examples

Mute Before Task

# Lower volume before playing audio
for _ in range(16):
    phone.volume_down()
    time.sleep(0.05)

# Perform task that might play audio
phone.open_app("Music")

Set Specific Volume Level

# First, go to minimum
for _ in range(16):
    phone.volume_down()
    time.sleep(0.05)

# Then set to 50%
for _ in range(8):
    phone.volume_up()
    time.sleep(0.05)

Quick Capture with Action Button

# If Action button is configured for Camera
phone.action_button()
time.sleep(1)

# Take screenshot of camera view
screenshot = phone.screenshot()

Volume Behavior

Volume buttons control different volumes depending on context:
  • When no media is playing: Ringer volume
  • During media playback: Media volume
  • In some apps: App-specific volume
Volume buttons don’t affect silent mode. Silent mode is controlled via the ring/silent switch (or Action button if configured).
Each volume press shows the volume HUD briefly. Add a small delay between presses for reliable adjustment.

Next Steps