# PlatformIO

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/ja-jp/help/clion/llms.txt).

> **TL;DR**
> OS : Windows、Linux、macOS
>
>
>
> CLion 用 PlatformIO プラグイン ：バンドル済み

[PlatformIO(英語)](https://platformio.org/) は、組み込み開発のためのオープンソースのエコシステムです。 ARM Cortex、AVR、MSP430 などの様々な MCU に加え、Arduino や ESP-IDF などの開発ボード、フレームワーク、開発環境にも対応しています。

CLion と PlatformIO の連携は、PlatformIO チームとの共同開発によって作成された [CLion の PlatformIO(英語)](https://plugins.jetbrains.com/plugin/13922-platformio-for-clion) プラグインによって実現されています。 このプラグインは IDE に同梱されているため、別途インストールする必要はありません。

## PlatformIO をインストールする

* PlatformIO をインストールするには、 [インストーラースクリプト(英語)](https://docs.platformio.org/en/latest/core/installation/methods/installer-script.html#super-quick-macos-linux)または他の [インストールオプション(英語)](https://docs.platformio.org/en/latest/core/installation.html#core-installation)のいずれかを使用します。

* 必ず [シェルコマンドをインストール(英語)](https://docs.platformio.org/en/latest/core/installation/shell-commands.html)してください。

## PlatformIO プロジェクトを作成または開く

Procedure: 新規プロジェクトを作成する

1. メインメニューから  `ファイル | 新規プロジェクト`  を呼び出し、左側のペインで   PlatformIO   を選択します。

2. プロジェクト名を設定し、ボードまたはフレームワークを選択して、   作成   をクリックします。

![Platformio プロジェクトウィザード](https://resources.jetbrains.com/help/img/idea/2026.3/cl_platformio_newprj_upd.png)

3. CLion は PlatformIO プロジェクトを生成します。

![新しい PlatformIO プロジェクトの生成](https://resources.jetbrains.com/help/img/idea/2026.3/cl_platformio_init_upd.png)

Arduino ベースのボードの場合、CLion は  `main.c`  ではなく  `main.cpp`  を生成し、Arduino 固有のスタブコードで埋めます。

![Arduino 固有のソーススタブ](https://resources.jetbrains.com/help/img/idea/2026.3/cl_platformio_arduino_stub_upd.png)

Procedure: プロジェクトを開く

1. オープン   を [ようこそ画面](welcome-screen.html) でクリックするか、メインメニューから  `ファイル | オープン`  を選択してください。

2. プロジェクトフォルダーに移動し、  `platformio.ini`  ファイルを選択します。

3. プロジェクトとして開く​   をクリックします。

> **Note:**
> 以前に生成した CMake ベースの PlatformIO プロジェクトを開くと、それを新しい構造に変換するように求められます。
>
>
>
> 変換が失敗した場合は、プロジェクトを閉じ、プロジェクトルートにある  `.idea`  フォルダーを削除して、プロジェクトを再度開きます。

## PlatformIO アクション

いくつかの [PlatformIO コマンド(英語)](https://docs.platformio.org/en/latest/core/userguide/index.html#commands)が IDE アクションとして利用可能です。 メインメニューで、  `ツール | PlatformIO`  に移動するか、プロジェクトツリーで  `platformio.ini`  を右クリックし、   PlatformIO   ノードを選択します。

![PlatformIO アクション](https://resources.jetbrains.com/help/img/idea/2026.3/cl_platformio_actions_upd.png)

* PlatformIO プロジェクトを再ロードする - [pio project init(英語)](https://docs.platformio.org/en/latest/core/userguide/project/cmd_init.html) を呼び出します。 このアクションを使用して、 `platformio.ini` の変更に従ってプロジェクトを更新します。

* 静的コード解析 - 静的コード分析のために [pio check(英語)](https://docs.platformio.org/en/latest/core/userguide/cmd_check.html) を呼び出します。

* PlatformIO シリアルモニター - [pio デバイスモニター(英語)](https://docs.platformio.org/en/latest/core/userguide/device/cmd_monitor.html)を呼び出します。

* プラットフォーム、ツールチェーンなどを更新する - [pio pkg update(英語)](https://docs.platformio.org/en/latest/core/userguide/cmd_update.html) を呼び出します。

* PlatformIO ホーム - `pio home` を呼び出し、ブラウザーで [PlatformIO ホーム(英語)](https://docs.platformio.org/en/latest/home/)を開きます。

> **Tip:**
> CLion の [内蔵ターミナル](terminal-emulator.html)から PlatformIO コマンドを実行することもできます。

## PlatformIO ツールウィンドウ

PlatformIO ツールウィンドウでは、最もよく使用されるコマンドやプロジェクトアクションにすばやくアクセスできます。

![PlatformIO ツールウィンドウ](https://resources.jetbrains.com/help/img/idea/2026.3/cl_platformio_toolwindow_upd.png)

アクションの上にマウスを置くと、対応するコマンドが表示されます。

![PlatformIO ツールウィンドウのコマンドのツールチップ](https://resources.jetbrains.com/help/img/idea/2026.3/cl_platformio_toolwindow_tooltips_upd.png)

下部には COM ポートスイッチャーがあります。 自動ポート検出に依存したくない場合は、これを使用してアップロード用の COM ポート番号を構成します。

## デバッグ機能

デバッグ   アクションは、  `pio debug`  を呼び出して、 [PIO 統合デバッガー(英語)](https://docs.platformio.org/en/latest/plus/debugging.html#piodebug)とのデバッグセッションを開始します。

すべての CLion [デバッグ機能](debugging-code.html)が利用でき、 [周辺レジスタビュー](peripheral-view.html)、 [メモリビュー](memory-view.html)、 [逆アセンブリ](disassembly-view.html)なども含まれます。

指定したプラットフォーム用の  `.svd`  ファイルがある場合、CLion が自動的に読み込みます。 手動で指定することもできます。

![.svd ファイルを指定する](https://resources.jetbrains.com/help/img/idea/2026.3/cl_platformio_loadsvd_upd.png)

## platformio.ini でのコーディング支援

PlatformIO プラグインとペアになっている   Ini   プラグインは、  `.ini`  ファイルの構文のハイライト、コードのフォーマット、 [構造ビュー](file-structure.html)を提供します。

`platformio.ini`  の構造ビューを開くには、エディターでそれを開き、メインメニューから  `表示 | ツールウィンドウ | 構造`  を選択するか、 `Ctrl+F12` (Windows), `⌘ F12` (macOS), `⌘ F12` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ 7` (macOS System Shortcuts), `Ctrl+F12` (XWin), `Ctrl+F12` (GNOME), `Ctrl+0` (KDE), `Ctrl+F12` (Emacs), `Ctrl+R` (Sublime Text), `⌘ R` (Sublime Text (macOS)), `⌃ 6` (Xcode), `Alt+\` (Visual Studio), `⌥ \` (Visual Studio (macOS)), `Ctrl+F12` (ReSharper), `⌘ F12` (ReSharper (macOS)), `Ctrl+F12` (QtCreator), `⌘ F12` (QtCreator (macOS)), `Ctrl+F12` (NetBeans), `Ctrl+F3` (Eclipse), `⌘ O` (Eclipse (macOS)) を押します。

Go to Symbol   (メインメニューの `Ctrl+Alt+Shift+N` (Windows), `⌘ ⌥ O` (macOS), `⌘ ⌥ ⇧ N` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ O` (macOS System Shortcuts), `Ctrl+Alt+Shift+N` (XWin), `Ctrl+Alt+Shift+N` (GNOME), `Ctrl+Alt+Shift+N` (KDE), `Ctrl+Alt+Shift+N` (Emacs), `Ctrl+Shift+R` (Sublime Text), `⌘ ⇧ R` (Sublime Text (macOS)), `⌘ ⇧ O` (Xcode), `Ctrl+Alt+Shift+T` (Visual Studio), `⌘ ⌥ ⇧ T` (Visual Studio (macOS)), `Ctrl+Alt+Shift+N` (ReSharper), `⌘ ⌥ ⇧ N` (ReSharper (macOS)), `Ctrl+Alt+Shift+N` (QtCreator), `⌘ ⌥ O` (QtCreator (macOS)), `Ctrl+Alt+Shift+O` (NetBeans), `Ctrl+Alt+Shift+N` (Eclipse), `⌘ ⌥ O` (Eclipse (macOS)) または  `移動 | シンボル`  ) を介してプロパティに移動できます。

![ini ファイルのコーディング支援](https://resources.jetbrains.com/help/img/idea/2026.3/cl_platformio_inifiles_upd.png)

また、Ini プラグインは、重複するプロパティとセクションを検出するための [インスペクションを提供](code-inspection.html)します。 これらのインスペクションの重大度を変更し、  `設定 | エディター | インスペクション | Ini ファイル`  でオン / オフを切り替えることができます。

## See also

### プロシージャ

[STM32CubeMX プロジェクト](embedded-stm32.html) [IAR ツールチェーン](iar-toolchain.html) [周辺ビュー](peripheral-view.html)

