aer

aer

Introduction to aer (PDF)

Local Apex Development and Testing

aer (Apex Execution Runtime) is an Apex interpreter and test runner. Run and test Apex code locally without deploying to Salesforce, dramatically speeding up your development workflow.

Key Features

  • Local Execution - Run Apex code on your machine without Salesforce deployment
  • Fast Testing - Execute unit tests in milliseconds instead of seconds
  • CI/CD Integration - Run tests in continuous integration pipelines
  • Standard Library - Full support for List, Map, Set, String, Date, JSON, HTTP, and more
  • Interactive Debugging - Set breakpoints in VS Code and inspect Apex state live

Basic Usage

# Run all tests in the SFDX source tree
aer test force-app

# Filter tests by class or method name
aer test force-app --filter AccountTest

# Execute anonymous Apex (or pipe code via stdin)
aer exec "System.debug('Hello, World');"

Interactive Debugging

Pair aer with the bundled aer Local Apex Debugger extension for VS Code to step through tests, inspect locals, and evaluate expressions without leaving your editor. Run aer test --debug force-app once and the CLI will install the extension (if needed), write .vscode/launch.json for you, and open VS Code ready to debug.

VS Code debugging Apex with aer showing breakpoints, variables, and call stack

Start a debug session from the Run and Debug view (F5) and set breakpoints anywhere in your Apex tests. See Interactive Debugging → for a full walkthrough.

Getting Started

Docs

Subscribe

Choose a plan on the pricing page.

Use Cases

  • Rapid Development - Test Apex logic locally without deployment delays
  • CI/CD Pipelines - Fast, parallel test execution in continuous integration
  • Learning Apex - Experiment with Apex without a Salesforce org
  • Code Analysis - Static analysis and validation of Apex codebases
  • Multi-Package Development - Test code depending on multiple managed packages

Language Support

  • Core Features - Classes, methods, properties, constructors, inheritance, interfaces
  • Collections - List, Map, Set with full method support
  • Control Flow - If/else, loops, try/catch/finally, switch statements
  • DML Operations - Insert, update, delete, undelete with Database class
  • SOQL - Query support with WHERE, ORDER BY, LIMIT, relationships
  • Declarative - Flows, validation rules, formula fields, lookup filters, sharing rules
  • Testing - @IsTest annotations, Test.startTest(), assert methods, HttpCalloutMock
  • Standard Library - String, Math, Date, Datetime, Decimal, JSON, Crypto, Pattern, HTTP, Limits, XML, Compression, DOM, Url, Approval, PageReference
  • DataWeave - DataWeave script execution
© 2012–2026 October Swimmer.