pio-run
builds PlatformIO projects
TLDR
Build project
$ pio run
Build and upload to device$ pio run --target upload
Build specific environment$ pio run -e [uno]
Clean build files$ pio run --target clean
Build specific environment and upload$ pio run -e [esp32dev] --target upload
Build from a specific project directory$ pio run -d [/path/to/project]
Build with verbose output for debugging$ pio run -v
Build with parallel jobs for faster compilation$ pio run -j [4]
SYNOPSIS
pio run [options]
DESCRIPTION
pio run builds PlatformIO projects. Compiles source code, links libraries, and optionally uploads firmware to target devices. It reads the `platformio.ini` configuration file to determine build environments, board settings, and library dependencies. This is the core command for the embedded development workflow with PlatformIO.Multiple environments can be defined in platformio.ini and selectively built with the -e flag. Common targets include upload (flash firmware), clean (remove build artifacts), and uploadfs (upload filesystem image).
PARAMETERS
-e, --environment name
Process specific environment defined in platformio.ini.-t, --target target
Process target (upload, clean, program, uploadfs, etc.).-d, --project-dir dir
Project directory (default: current directory).--upload-port port
Upload port (e.g., /dev/ttyUSB0 or COM3).-j, --jobs num
Number of parallel build jobs.-v, --verbose
Verbose output showing full compiler commands.-s, --silent
Suppress all output except errors.--disable-auto-clean
Disable automatic cleaning if environment configuration has changed.--list-targets
List available project targets.
SEE ALSO
pio-init(1), pio-device(1), pio-test(1), pio-check(1), pio-debug(1), pio-boards(1)
