Environment variables
are a set of dynamic named values that can affect the way running processes
will behave on a computer. PlatformIO handles variables which start with
PLATFORMIO_
prefix.
How to set environment variable?
# Windows
set VARIABLE_NAME=VALUE
# Windows GUI -> https://www.youtube.com/watch?v=bEroNNzqlF4
# Unix (bash, zsh)
export VARIABLE_NAME=VALUE
# Unix (fish)
set -x VARIABLE_NAME VALUE
PlatformIO uses General environment variables for the common operations/commands.
PlatformIO handles CI
variable which is setup by
Continuous Integration
(Travis, Circle and etc.) systems.
PlatformIO uses it to disable prompts and progress bars. In other words,
CI=true
automatically setup PLATFORMIO_DISABLE_PROGRESSBAR
to
true
.
Allows one to specify Personal Authentication Token that could be used for automatic login in to PIO Account. It is very useful for Continuous Integration systems and PIO Remote operations where you are not able manually authorize.
You can get own Personal Authentication Token using platformio account token command.
Force to output color ANSI-codes even if the output is a pipe
(not a tty
).
The possible values are true
and false
. Default is PLATFORMIO_FORCE_COLOR=false
.
Disable color ANSI-codes even if the output is a pipe
(not a tty
).
The possible values are true
and false
. Default is PLATFORMIO_DISABLE_COLOR=false
.
Disable progress bar for package/library downloader and uploader. This is
useful when calling PlatformIO from subprocess and output is a pipe
(not a tty
).
The possible values are true
and false
. Default is PLATFORMIO_DISABLE_PROGRESSBAR=false
.
Allows one to override “platformio.ini” (Project Configuration File) option core_dir.
Allows one to override “platformio.ini” (Project Configuration File) option globallib_dir.
Allows one to override “platformio.ini” (Project Configuration File) option platforms_dir.
Allows one to override “platformio.ini” (Project Configuration File) option packages_dir.
Allows one to override “platformio.ini” (Project Configuration File) option cache_dir.
Allows one to override “platformio.ini” (Project Configuration File) option build_cache_dir.
Allows one to override “platformio.ini” (Project Configuration File) option workspace_dir.
Allows one to override “platformio.ini” (Project Configuration File) option include_dir.
Allows one to override “platformio.ini” (Project Configuration File) option src_dir.
Allows one to override “platformio.ini” (Project Configuration File) option lib_dir.
Allows one to override “platformio.ini” (Project Configuration File) option libdeps_dir.
Allows one to override “platformio.ini” (Project Configuration File) option build_dir.
Allows one to override “platformio.ini” (Project Configuration File) option data_dir.
Allows one to override “platformio.ini” (Project Configuration File) option test_dir.
Allows one to override “platformio.ini” (Project Configuration File) option boards_dir.
Allows one to override “platformio.ini” (Project Configuration File) option shared_dir.
Allows one to override platformio remote agent start --working-dir
.
Allows one to set “platformio.ini” (Project Configuration File) option lib_extra_dirs.
Allows one to set “platformio.ini” (Project Configuration File) option build_flags.
Examples:
# Unix:
export PLATFORMIO_BUILD_FLAGS=-DFOO
export PLATFORMIO_BUILD_FLAGS=-DFOO -DBAR=1 -DFLOAT_VALUE=1.23457e+07
export PLATFORMIO_BUILD_FLAGS='-DWIFI_PASS=\"My password\"' '-DWIFI_SSID=\"My ssid name\"'
# Windows:
SET PLATFORMIO_BUILD_FLAGS=-DFOO
SET PLATFORMIO_BUILD_FLAGS=-DFOO -DBAR=1 -DFLOAT_VALUE=1.23457e+07
SET PLATFORMIO_BUILD_FLAGS='-DWIFI_PASS="My password"' '-DWIFI_SSID="My ssid name"'
Allows one to set “platformio.ini” (Project Configuration File) option src_build_flags.
Allows one to set “platformio.ini” (Project Configuration File) option src_filter.
Allows one to set “platformio.ini” (Project Configuration File) option extra_scripts.
Allows one to set “platformio.ini” (Project Configuration File) option default_envs.
Allows one to set “platformio.ini” (Project Configuration File) option upload_port.
Allows one to set “platformio.ini” (Project Configuration File) option upload_flags.
Allows one to override PlatformIO settings. You can manage them via platformio settings command.
Allows one to override setting auto_update_libraries.
Allows one to override setting auto_update_platforms.
Allows one to override setting check_libraries_interval.
Allows one to override setting check_platformio_interval.
Allows one to override setting check_platforms_interval.
Allows one to override setting enable_cache.
Allows one to override setting strict_ssl.
Allows one to override setting enable_telemetry.
Allows one to override setting force_verbose.
Allows one to override setting projects_dir.