Configuration

Configuration

aer is configured with command-line flags. This page covers the ways to set those flags once instead of on every run, and the flags that set org-wide defaults such as time zone, locale, and currency.

Default flags in .aerrc

An .aerrc file holds flags that apply to every aer command run from a project. aer reads up to three files, in increasing order of precedence:

  1. $XDG_CONFIG_HOME/aer/aerrc, or ~/.config/aer/aerrc when XDG_CONFIG_HOME is unset
  2. ~/.aerrc
  3. ./.aerrc in the current directory

The format is one flag per line, optionally followed by its value:

# default flags for every aer run in this project
--package-dir packages
--certificate-dir testdata/certificates
--timezone America/Chicago
-v

Blank lines, lines starting with #, and lines not starting with - are ignored. Environment variables such as $HOME are expanded.

Flags from these files are applied to the invoked subcommand before your own command-line arguments, so a flag passed explicitly on the command line overrides the file. A flag given on the command line replaces its .aerrc default entirely: passing --package-dir other on the command line loads other instead of both other and packages.

A flag that is not valid for the command being run is ignored. One .aerrc can therefore hold defaults for several commands. In the example above, --certificate-dir applies to aer test and aer exec and is dropped for aer package.

Set AER_NO_RC in the environment to ignore all .aerrc files for a run:

AER_NO_RC=1 aer test force-app/main/default

Run aer --help-aerrc to print this description along with the resolved paths of the three files on your machine.

Org defaults

The exec, test, and server commands accept flags that set org-wide defaults. Each is a good candidate for .aerrc.

Time zone

--timezone sets the default time zone for new users, including the default user tests run as:

aer test force-app/main/default --timezone America/Los_Angeles

Locale

--locale sets the org’s default locale. It seeds the default user’s LocaleSidKey and is used wherever aer previously assumed en_US: UserInfo.getLocale(), Integer.format(), users created with System.runAs, Organization.DefaultLocaleSidKey, and flow interviews.

aer test force-app/main/default --locale de_DE

Currency

--currency sets the org’s default currency and is validated against the ISO 4217 currency codes. UserInfo.getDefaultCurrency() resolves the running user’s CurrencyIsoCode, then the corporate CurrencyType, then the user’s DefaultCurrencyIsoCode, then this value.

aer test force-app/main/default --currency EUR

With the MultiCurrency feature enabled, the configured currency becomes the corporate CurrencyType at a conversion rate of 1.0, and the seeded DatedConversionRate rows match.

Fixed clock

--faketime sets the starting value of Datetime.now() and Date.today(). Time advances normally from that point. The value is an RFC 3339 timestamp:

aer test force-app/main/default --faketime 2025-10-26T18:00:00-05:00

Environment variables

VariablePurpose
AER_LICENSE_KEYLicense key, used in CI where aer license register is not practical.
AER_NO_RCWhen set, skip every .aerrc file.
AER_SEED_SESSION_TOKENEquivalent to aer server --seed-session-token. See Development Server.
AER_SMTP_HOST, AER_SMTP_PORT, AER_SMTP_USER, AER_SMTP_PASSWORDSMTP server used by --allow-email. Default to a local mail transfer agent on localhost:25 with no authentication.

Sending real email

By default Messaging.sendEmail is mocked. Addresses and bodies are validated the way sfapex validates them, Apex observes a successful SendEmailResult, and the outcome is logged to stderr, but no message is sent.

Pass --allow-email to aer exec or aer server to deliver mail over SMTP using the AER_SMTP_* variables above:

AER_SMTP_HOST=smtp.example.com AER_SMTP_PORT=587 \
AER_SMTP_USER=aer AER_SMTP_PASSWORD=secret \
aer server force-app/main/default --allow-email

Recipients come from the To, Cc, and Bcc lists. Record Id and targetObjectId recipients resolve to the record’s Email field. The From address is resolved from the org-wide email address when one is set, otherwise from the running user.

© 2012–2026 October Swimmer.