Skip to content

Instantly share code, notes, and snippets.

Last active November 28, 2023 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zsarge/61c9982280388477d6025a67b0699a6d to your computer and use it in GitHub Desktop.
Save zsarge/61c9982280388477d6025a67b0699a6d to your computer and use it in GitHub Desktop.
set -e
# this script:
# 1. downloads downloads drivers for USB to UART (requires GUI input)
# 2. installs Xcode command line tools with homebrew
# 3. installs Arduino IDE and adds it to the dock
# 4. downloads Arduino CLI
# 5. adds board support for ESP32s
# Running this script with sudo minimizes developer interaction
# trigger prompt for sudo password before developer walks away
sudo ls
# install drivers and xcode support first, because they require GUI installers
# install USB to UART drivers on Mac
# from
cd macOS_VCP_Driver
# allow apps to be downloaded from app store or identified developers?? Not enabled yet. idk if this is what I want
## sudo spctl --master-disable
hdiutil attach SiLabsUSBDriverDisk.dmg
# trigger GUI installation
open /Volumes/Silicon\ Labs\ VCP\ Driver\ Install\ Disk/Install\ CP210x\ VCP\
echo "hit ENTER to continue"
read # wait for user to finish installation
hdiutil detach "/Volumes/Silicon Labs VCP Driver Install Disk/"
# install xcode support through homebrew (assuming brew is not installed)
/bin/bash -c "$(curl -fsSL"
echo "this should have automatically installed XCode Command Line Tools. hopefully."
# Download Arduino IDE image
curl -L -O "$source"
echo "installing dmg"
hdiutil attach arduino-ide_latest_macOS_64bit.dmg
echo "installing app"
sudo cp -R "/Volumes/Arduino IDE 2.2.1/Arduino" /Applications
echo "detatching img"
hdiutil detach "/Volumes/Arduino IDE 2.2.1"
# add Arduino IDE to dock for easy access
defaults write persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Arduino</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>'
killall Dock
echo "/Users/$USER/.arduino_cli" | sudo tee -a /etc/paths
mkdir ~/.arduino_cli
curl -fsSL | BINDIR=~/.arduino_cli sh
source /etc/profile # reload $PATH
# install esp32 board support with arduino cli
arduino-cli config init
arduino-cli config set board_manager.additional_urls ""
arduino-cli config set library.enable_unsafe_install true
arduino-cli core update-index
arduino-cli core install esp32:esp32
echo "install script finished!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment