During installation, check the box to add VS Code to your PATH.
Verify the availability of 'code' in your environment. (Optional)
Open a terminal or command prompt and run: code --version
If you get an error like
'code' is not recognized as an internal or external command', the command is not in your system path. Please add code to system path.
Step C. Setting Python Interpreter in VS Code to run ADS scripts
Open Folder in VS Code that contains where your ADS scripts are located.
Configure python interpeter to use ADS modules
Use the View▸Command Palette (Ctrl+Shift+P) and select "ADS Python Utilities: Configure Python Interpreter Path".
windows: %HPEESOF_DIR%\tools\python\python.exe or C:\Program Files\Keysight\<ADS Directory>\tools\python\python.exe"
linux: $HPEESOF_DIR/tools/python/bin/python3
Add ADS python source to VS Code to improve code completion, debugging and copilot suggestions (Optional)
Use the View▸Command Palette (Ctrl+Shift+P) and select "ADS Python Utilities: Add ADS Python to Workspace".
In chat panel, change the mode to 'ADS-API' to ask copilot for help with ADS Python Support.
Add launch configuration for executing and debugging python scripts (Optional)
Use the View▸Command Palette (Ctrl+Shift+P) and select "ADS Python Utilities: Add Python Launch Configuration".
Step D – Activate add-on in ADS and attach VS Code python debugger to debug scripts executing within ADS
Launch ADS.
Open Tools▸App Manager….
Enable Python VS Code Utilities
Start a debug session
Open Tools▸Python Console.
Click "Start Debugger" Button.
VS Code gains focus (or launches) and attaches to ADS through debugpy on port 8765.
Default ports: ADS → 8765, DDS → 8766.
(Optional) Custom port - You can change the port used by the debugger in two ways.
Method 1: Set an Environment Variable
Set an environment variable before starting ADS, This variable tells the addon to use your preferred port instead of the default. For example, in a Windows command prompt:
set DE_DEBUGPY_PORT 8768 or set DDS_DEBUGPY_PORT 8767
ADS will now listen on the specified port (e.g. 8768) instead of the default, and the “Start Debugger” button will open VS Code on that port.
Method 2: Modify the Addon File Directly
If you prefer not to use environment variables, you can directly edit the addon's .py file.
Locate the DEFAULT_PORTS dictionary near the top of the file (in /prod/addons/debugpy_attach/init.py) and change the port numbers to your desired values:
Default debug-adapter port per profile
DEFAULT_PORTS = {
"de": 8765, # Change this value for the Layout / DE process
"dds": 8766, # Change this value for the Data-Display process
}
Note : Within one ADS session debugpy can listen on only one port.
Re-attaching: If you click Start Debugger while a VS Code session is already attached you’ll see: A VS Code session is already connected on port 8765(default port). Disconnect in VS Code and click "Start Debugger" button again to re-attach.