← 返回命令列表

Linux command

pio 命令

文本

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

常用示例

Initialize new project

pio project init --board [uno]

Build project

pio run

Upload to board

pio run --target upload

Monitor serial port

pio device monitor

List boards

pio boards [search_term]

Install library

pio pkg install --library "[library_name]"

Run tests

pio test

Check for updates

pio pkg update

说明

pio (PlatformIO Core CLI) is a development platform for embedded systems. It supports hundreds of boards including Arduino, ESP32, STM32, and more. Project initialization creates the directory structure and configuration. The platformio.ini file defines boards, frameworks, and dependencies. Building compiles code for target platforms. Multiple environments can be defined for different boards or configurations. Upload transfers firmware to connected devices. Serial monitor provides interactive communication for debugging. Library management handles dependencies. Libraries are installed globally or per-project. The registry contains thousands of libraries. Unit testing runs on embedded devices or host machines. This enables test-driven development for firmware. VS Code integration through the PlatformIO IDE extension provides a full development environment.

参数

project init
Initialize project.
run
Build project.
run -t upload
Upload firmware.
run -t clean
Clean build.
device monitor
Serial monitor.
device list
List devices.
boards _QUERY_
Search boards.
pkg install
Install package.
pkg update
Update packages.
pkg list
List packages.
test
Run unit tests.
-e _ENV_
Target environment.
-d _DIR_
Project directory.
-v
Verbose output.

FAQ

What is the pio command used for?

pio (PlatformIO Core CLI) is a development platform for embedded systems. It supports hundreds of boards including Arduino, ESP32, STM32, and more. Project initialization creates the directory structure and configuration. The platformio.ini file defines boards, frameworks, and dependencies. Building compiles code for target platforms. Multiple environments can be defined for different boards or configurations. Upload transfers firmware to connected devices. Serial monitor provides interactive communication for debugging. Library management handles dependencies. Libraries are installed globally or per-project. The registry contains thousands of libraries. Unit testing runs on embedded devices or host machines. This enables test-driven development for firmware. VS Code integration through the PlatformIO IDE extension provides a full development environment.

How do I run a basic pio example?

Run `pio project init --board [uno]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does project init do in pio?

Initialize project.