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:Complete environment setup
Install Python 3.13.12, Visual Studio 2022/2026, and uv as described in the setup guide
Launching NVDA from Source
Once the source tree is prepared, launch NVDA using the batch file:What Happens When You Run
Therunnvda.bat script:
- Activates the Python virtual environment
- Sets up the correct Python path to use
source/directory - Launches the NVDA Python application
- Loads all compiled C++ components (nvdaHelper DLLs)
- 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
Common Options
Use a specific configuration directoryUseful for testing with clean configuration or multiple configurations.
Start NVDA without loading any add-onsHelpful for isolating issues caused by add-ons.
Enable debug-level loggingProvides detailed logs for troubleshooting.
Specify custom log file location
Set logging level (DEBUG, IO, INFO, WARNING, ERROR)
Restart NVDA after it exits
Don’t set the system screen reader flagAllows running alongside another screen reader.
Example: Clean Testing Environment
Test with a fresh configuration:- Uses a temporary configuration directory
- Disables all add-ons
- Enables verbose debug logging
Development Workflow
Typical Development Cycle
Testing Scenarios
Testing with Multiple Configurations
Maintain separate configuration directories for different testing scenarios:Testing Braille Displays
Run with braille debugging:IO log level includes input/output operations for braille devices.
Testing Speech Synthesizers
Test specific speech synthesizer:Testing Startup Behavior
Test NVDA’s startup sequence:Debugging Techniques
Using Python Debugger
Attach a Python debugger to inspect code execution: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__/.
Development vs. Release Performance
Running from source is slower than release builds because:- Python code isn’t optimized with
-Oflag - 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=1Common Issues
NVDA won't start after changes
NVDA won't start after changes
Check for Python syntax errors:Review the log file:
Changes not reflected when running
Changes not reflected when running
For Python files:
- Ensure you saved the file
- Delete bytecode cache if present
- Restart NVDA
Import errors for dependencies
Import errors for dependencies
The virtual environment may be outdated:
NVDA crashes immediately
NVDA crashes immediately
Check for missing DLLs or corrupted build:Review crash log in
%TEMP%\nvda-crash.logCOM interface errors
COM interface errors
Rebuild COM interfaces:
Can't run multiple instances
Can't run multiple instances
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
runnvda.batBuild Binary
Use for:
- Release testing
- Performance validation
- Distribution
- Installing on other systems
scons launcherTesting 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: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
