Skip to main content

Overview

Running NVDA from source is the most efficient way to develop and test changes. You can launch NVDA directly without building installers or portable distributions.
Running from source requires completing the setup guide and preparing the source tree first.

Prerequisites

Before running from source:
1

Complete environment setup

Install Python 3.13.12, Visual Studio 2022/2026, and uv as described in the setup guide
2

Clone the repository

Clone with --recursive to include all submodules:
3

Prepare the source tree

Build C++ components and prepare dependencies:

Launching NVDA from Source

Once the source tree is prepared, launch NVDA using the batch file:
This starts NVDA with your source code changes immediately.

What Happens When You Run

The runnvda.bat script:
  1. Activates the Python virtual environment
  2. Sets up the correct Python path to use source/ directory
  3. Launches the NVDA Python application
  4. Loads all compiled C++ components (nvdaHelper DLLs)
  5. Initializes the screen reader with current source code
Changes to Python files (.py) are reflected immediately on the next launch. Changes to C++ code require rebuilding with scons source.

Command Line Options

NVDA accepts numerous command-line arguments for testing and debugging:

View Available Options

or

Common Options

path
Use a specific configuration directory
Useful for testing with clean configuration or multiple configurations.
boolean
Start NVDA without loading any add-ons
Helpful for isolating issues caused by add-ons.
boolean
Enable debug-level logging
Provides detailed logs for troubleshooting.
path
Specify custom log file location
string
Set logging level (DEBUG, IO, INFO, WARNING, ERROR)
boolean
Restart NVDA after it exits
boolean
Don’t set the system screen reader flag
Allows running alongside another screen reader.

Example: Clean Testing Environment

Test with a fresh configuration:
This:
  • Uses a temporary configuration directory
  • Disables all add-ons
  • Enables verbose debug logging

Development Workflow

Typical Development Cycle

1

Make code changes

Edit Python files in the source/ directory or C++ files in nvdaHelper/
2

Rebuild if needed

For C++ changes:
For Python changes, no rebuild needed.
3

Launch NVDA

4

Test your changes

Interact with applications and verify your modifications work correctly
5

Check logs

Review logs for errors or warnings:
6

Iterate

Exit NVDA, make adjustments, and relaunch to test again

Testing Scenarios

Testing with Multiple Configurations

Maintain separate configuration directories for different testing scenarios:

Testing Braille Displays

Run with braille debugging:
The IO log level includes input/output operations for braille devices.

Testing Speech Synthesizers

Test specific speech synthesizer:
Then change synthesizer in NVDA settings.

Testing Startup Behavior

Test NVDA’s startup sequence:

Debugging Techniques

Using Python Debugger

Attach a Python debugger to inspect code execution:
Then connect with VS Code or another debugger on port 5678.

Logging and Print Statements

Add logging to track execution:

Viewing Real-Time Logs

Monitor logs while NVDA runs:

Performance Considerations

Python Bytecode Caching

Python automatically creates .pyc bytecode files in source/__pycache__/.
Sometimes stale bytecode can cause unexpected behavior. If you encounter strange issues, delete the cache:

Development vs. Release Performance

Running from source is slower than release builds because:
  • Python code isn’t optimized with -O flag
  • No whole-program optimization for C++ components
  • Debug symbols are present
  • Additional runtime checks are enabled
For performance testing, create a release build with scons launcher release=1

Common Issues

Check for Python syntax errors:
Review the log file:
For Python files:
  • Ensure you saved the file
  • Delete bytecode cache if present
  • Restart NVDA
For C++ files:
The virtual environment may be outdated:
Check for missing DLLs or corrupted build:
Review crash log in %TEMP%\nvda-crash.log
Rebuild COM interfaces:
By default, NVDA prevents multiple instances. To run multiple instances for testing:

Building vs. Running from Source

When to Use Each Approach

Run from Source

Use for:
  • Daily development
  • Quick testing
  • Debugging
  • Python-only changes
Command: runnvda.bat

Build Binary

Use for:
  • Release testing
  • Performance validation
  • Distribution
  • Installing on other systems
Command: scons launcher

Testing Best Practices

1. Use Separate Configuration Directories

Never test with your personal NVDA configuration:

2. Enable Debug Logging by Default

Create a batch file for development:
Save as dev-run.bat in the repository root.

3. Test with Add-ons Disabled

First verify issues without add-ons:

4. Document Test Scenarios

Create batch files for common test scenarios:

5. Review Logs After Testing

Always check logs for warnings or errors:

Accessing User Documentation

If you need user documentation available in the Help menu:
Building user documentation is slower. Skip it for routine development unless you’re specifically testing documentation features.

Next Steps

Building NVDA

Learn how to create binary builds and installers

Development Overview

Understand NVDA’s architecture and workflow

GitHub Repository

Browse the source code and submit contributions

Command Line Options

Full list of command-line arguments