How to run PlatformIO build & upload from the command line
First, activate the PlatformIO virtual environment which will give you access to the pio script:
pio_activate.sh
source ~/.platformio/penv/bin/activateNow, if you have - for example - an environment called esp32dev listed in platformio.ini:
platformio.ini
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduinoyou can build & upload using the following code:
pio_run_upload.sh
pio run -e esp32dev -t uploadYou can also combine both commands (the virtual env activation and the pio run command) into a single line of shell script:
pio_activate_and_upload.sh
source ~/.platformio/penv/bin/activate && pio run -e esp32dev -t uploadCheck out similar posts by category:
PlatformIO
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow