← 返回命令列表

Linux command

pio-run 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

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

pio run -e [esp32dev] --target upload

Build from a specific

pio run -d [/path/to/project]

Build with verbose

pio run -v

Build with parallel

pio run -j [4]

说明

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).

参数

-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.

FAQ

What is the pio-run command used for?

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).

How do I run a basic pio-run example?

Run `pio run` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -e, --environment _name_ do in pio-run?

Process specific environment defined in platformio.ini.