Skip to content

Instantly share code, notes, and snippets.

@skymobilebuilds
Created November 7, 2023 11:13
Show Gist options
  • Save skymobilebuilds/419916321ff970357e9afc755851826a to your computer and use it in GitHub Desktop.
Save skymobilebuilds/419916321ff970357e9afc755851826a to your computer and use it in GitHub Desktop.
Add Firewall exception for Xcode and Simulator
#!/bin/bash -e
# Script to disable the iOS Simulator app from showing the "Do you want the application xxxx to accept incoming network connections?" pop-up every time the app is run
echo "> Enter password to temporarily shut firewall off"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
echo "> Add Xcode as a firewall exception"
/usr/libexec/ApplicationFirewall/socketfilterfw --add /Applications/Xcode.app/Contents/MacOS/Xcode
echo "> Add iOS Simulator as a firewall exception"
/usr/libexec/ApplicationFirewall/socketfilterfw --add /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator
echo "> Re-enable firewall"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
@skymobilebuilds
Copy link
Author

skymobilebuilds commented Nov 7, 2023

How to use it

curl https://gist.githubusercontent.com/skymobilebuilds/419916321ff970357e9afc755851826a/raw/521633d70b5e35cfe6ffacdf791af3c48e40b0ba/iOS-dev-firewall-setup.sh | sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment