LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pio-run

builds PlatformIO projects

TLDR

Build project
$ pio run
copy
Build and upload to device
$ pio run --target upload
copy
Build specific environment
$ pio run -e [uno]
copy
Clean build files
$ pio run --target clean
copy
Build specific environment and upload
$ pio run -e [esp32dev] --target upload
copy
Build from a specific project directory
$ pio run -d [/path/to/project]
copy
Build with verbose output for debugging
$ pio run -v
copy
Build with parallel jobs for faster compilation
$ pio run -j [4]
copy

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

Copied to clipboard
Kai