Installation instructions: here
$ brew install tor
sudo mv /usr/local/etc/tor/torrc.sample /usr/local/etc/tor/torrc
This will take a few steps, you may want to setup a script to handle doing these things for you automatically:
service_identifier=`printf "open\nget State:/Network/Global/IPv4\nd.show" | scutil | grep "PrimaryService" | awk '{print $3}'`
service_name=`printf "open\nget Setup:/Network/Service/$service_identifier\nd.show" | scutil | grep "UserDefinedName" | awk -F': ' '{print $2}'`
sudo networksetup -setsocksfirewallproxy "$service_name" localhost $tor_port
(by default the tor port is 9050)
sudo networksetup -setsocksfirewallproxystate "$service_name" on
based on the instructions when installing tor, you will want to run brew services
then brew services start tor
so that it gets automatically started with your computer.