Skip to content
Projects

SuperMonster003/AutoJs6-VSCode-Extension

View on GitHub

About

Debugger for AutoJs6 on VSCode (VSCode 平台的 AutoJs6 调试器)

Developer Tools

How these counts are measured

What you can do

  • 在 VSCode 中连接设备并操作 AutoJs6 的脚本或项目 (运行 / 停止 / 保存 等)
  • 在 VSCode 中实时显示 AutoJs6 的日志
  • 扫描二维码建立连接, 局域网内自动发现开启服务端模式的设备 (AutoJs6 6.8.0+)
  • 配对确认: 未知设备接入前询问, 扫码连接的设备自动信任, 可管理已信任设备

Measured star growth

in 24h
0
in 7 days
+1
in 15 days
0
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

.readme/README-en.md

Original

AutoJs6 VSCode Extension

Languages

autojs6-vscode-ext-banner_1024×310

AutoJs6 (AutoJs6 debugger, VSCode extension)

Debugger for AutoJs6 on VSCode

GitHub closed issues GitHub AutoJs6 repository GitHub top language
Created GitHub Code Size GitHub License


AutoJs6 VSCode development extension



Installation (Install)


  • VSCode menu View - Extensions [ Ctrl+Shift+X ]
  • Search for "AutoJs6" or "003"
  • Select "AutoJs6 VSCode Extension" and install or update it

Features (Features)


  • Connect devices in VSCode and manage AutoJs6 scripts or projects (run, stop, save, etc.)
  • Display AutoJs6 logs in real time in VSCode
  • Connect by QR code and discover devices running server mode on the local network (AutoJs6 6.8.0+)
  • Pairing confirmation asks before accepting an unknown device, trusts QR-paired devices automatically, and lets you manage trusted devices
  • Browse, edit, upload, download and delete device files, run device scripts, and transfer large files in chunks with progress (AutoJs6 6.8.0+)
  • Pull project changes from a device (device edits -> local files, with per-file diff previews)
  • Heartbeats, automatic reconnection and a status-bar device indicator
  • A local HTTP command bridge lets external tools invoke extension commands
  • Interface text follows the VSCode display language (Simplified Chinese / English), or can be pinned through autojs6.language

Usage (Usage)


  1. Basic operations
  • < Command Palette >
    • VSCode menu View - Command Palette [ Ctrl+Shift+P ]
  • < Developer Tools >
    • VSCode menu Help - Toggle Developer Tools
  • < Menu buttons >
    • Buttons at the top of the VSCode title area provide quick file/project operations
  1. Connect to the computer
  • Open < Command Palette > and select AutoJs6: Connect [ Ctrl+Alt+F6 ], or click the corresponding menu button
  • Choose one of the following connection methods
    • Server | LAN
      • Enable "Client mode" in the AutoJs6 drawer
      • Enter a local IP address shown by VSCode (the extension listens on 6347; allow it through the firewall and change it with autojs6.server.port)
    • Server | QR Code
      • VSCode displays the connection QR code for this computer; you can switch network interfaces
      • In the AutoJs6 (6.8.0+) drawer, select "Client mode" and use the scan button beside the address field to scan the code and connect automatically
    • Client | LAN
      • Enable "Server mode" in the AutoJs6 drawer (listening on 7347)
      • In VSCode, enter the IP address or hostname of the AutoJs6 device, optionally with a port (such as 192.168.1.5:7347 or [fe80::1]:7347)
      • After an unexpected disconnect, the extension reconnects automatically with exponential backoff for 5 minutes by default (disable with autojs6.connection.autoReconnect); VSCode restores the last connection after restarting (autojs6.connection.restoreOnStartup)
      • An explicit disconnect from either side (VSCode commands or the AutoJs6 drawer/manager) stops automatic reconnection
    • Client | Android Debug Bridge (ADB)
      • Enable "Server mode" in the AutoJs6 drawer
      • Connect the AutoJs6 device to the computer running VSCode through USB
      • Enable USB debugging on the AutoJs6 device and allow it to trust the computer
      • The procedure varies by device; consult its manufacturer's manual or relevant online documentation
    • History (IP)
      • Successful device IP addresses are saved in a selection list
      • Enable "Server mode" in AutoJs6
      • A device's IP address may change
      • Use "Clear" to remove all saved records
  • A VSCode message AutoJs6 device connected: ${DEVICE} (${IP_ADDRESS}) confirms the connection
  1. Run commands
  • Open < Command Palette > to view and run supported commands; shortcuts are listed under "Commands" below
  • For example, AutoJs6: Run and AutoJs6: Stop All
  • Some operations also have corresponding menu buttons
  1. View logs
  • Choose one of the following ways to view logs from AutoJs6
    • Use the OUTPUT panel [ F12 ] opened after connecting; each device has its own panel
    • Click the AutoJs6: N status-bar indicator, select a device and choose "Show logs"
  • After disconnection, the panel is retained and marked disconnected by default; autojs6.log.disposeChannelOnDisconnect can remove it automatically
  • Enable the extension's own debug logs through autojs6.log.debug; they appear in AutoJs6 VSCode Extension Debug
  1. Manage device files (AutoJs6 6.8.0+)
  • Click the AutoJs6 activity-bar icon and browse connected devices' working directories and external storage in "Device Files (Device Files)"
  • Click a file to open it in the editor; saving in VSCode writes changes directly back to the device
  • Context menus and inline buttons run scripts, create folders/files, upload current or local files, download, rename and delete
  • Choose "Upload folders here (Upload Folders)" on a device directory to select multiple local folders. Selected names, subdirectories and empty directories are preserved; existing directories are merged, matching files overwritten, and other device files retained. Uploads show the current path and support cancellation while keeping uploaded content; symlinks and unsupported file types are skipped with a notice
  • AutoJs6: Browse Device Files adds a device directory to Explorer as a workspace folder
  1. Disconnect
  • Choose one of the following ways to close all connections between AutoJs6 and VSCode
    • Open < Command Palette > and select AutoJs6: Disconnect All [ Ctrl+Alt+Shift+F6 ]
    • Turn off the relevant client/server switch in the AutoJs6 drawer
    • Disconnect the USB connection of AutoJs6 (only for ADB (USB) connections)
    • Exit the AutoJs6 app or close VSCode

Commands (Commands)


  • View online documentation (View Online Document) [ Alt+Shift+F6 ]
    • Open the AutoJs6 online developer documentation
  • Connect a device (Connect) [ Ctrl+Alt+F6 ]
    • Connect AutoJs6 and VSCode
    • The relevant AutoJs6 switches may need manual enablement
  • Show connection QR code (Show QR Code) [ CTRL+ALT+6 Q ]
    • Show a QR code for the AutoJs6 client mode to scan
  • Disconnect all (Disconnect All) [ Ctrl+Alt+Shift+F6 ]
    • Close every established connection
    • The relevant AutoJs6 switches may be reset
  • Disconnect a device (Disconnect Device)
    • Select the device to disconnect
  • Reconnect the last device (Reconnect)
    • Retry a reconnecting target immediately, or restore the last successful LAN/ADB connection
  • Stop automatic reconnection (Cancel Reconnect)
    • Stop all ongoing automatic-reconnection sessions
  • Pull project changes from a device (Pull Project from Device)
    • Compare the device copy with the local project, select new/modified device files to pull, and preview each diff
  • Manage trusted devices (Manage Trusted Devices)
    • View and remove trusted AutoJs6 devices; a removed device requires confirmation the next time it connects
  • Select a device (Select Device)
    • List connected devices and choose an action (logs, run, save, browse files or disconnect), also available through the status-bar indicator
  • Run script (Run) [ F6 ]
    • Run the script corresponding to the current VSCode
    • Applies to all connected devices
  • Rerun script (Rerun)
    • Stop and rerun the script corresponding to the current VSCode
    • Applies to all connected devices
  • Stop current script (Stop) [ Ctrl+F6 ]
    • Stop the script corresponding to the current VSCode
    • Applies to all connected devices
  • Stop all scripts (Stop All) [ Ctrl+Shift+F6 ]
    • Stop all running scripts
    • Applies to all connected devices
  • Save to all devices (Save)
    • Save the current file to the AutoJs6 working directory of connected devices
    • Applies to all connected devices
  • Run on a selected device (Run On Device)
    • Open the device menu and choose where to run the script corresponding to VSCode
  • Save to a selected device (Save To Device)
    • Open the device menu and choose where to save the script corresponding to VSCode
  • New project (New Project) [ CTRL+ALT+6 N ]
    • Select an empty folder, creating one if needed, for a new AutoJs6 project
    • After creating a project, run npm run dts-link or npm run dts to deploy declarations
  • Run project (Run Project) [ CTRL+ALT+6 R / Alt+F6 ]
    • Run an AutoJs6 project
  • Save project to device (Save Project) [ CTRL+ALT+6 S ]
    • Save an AutoJs6 project incrementally; propagating file deletions to the device requires AutoJs6 6.8.0+
  • Resynchronize the entire project (Resync Project)
    • Send every project file to the device and overwrite matching files
  • Browse device files (Browse Device Files)
    • Add a device directory to Explorer as a workspace folder (AutoJs6 6.8.0+)

Settings (Settings)


Setting Default Description
autojs6.language auto Interface language: auto follows the VSCode display language; en or zh-cn pins it. Command titles and setting descriptions always follow VSCode; reload the window to apply every change
autojs6.server.port 6347 Extension listening port, used by AutoJs6 client mode
autojs6.server.confirmUnknownDevices true Ask before accepting an unknown client-mode device; QR-paired or previously allowed-and-remembered devices need no confirmation
autojs6.client.port 7347 Default port for AutoJs6 server mode
autojs6.http.enabled / autojs6.http.host / autojs6.http.port true / 127.0.0.1 / 10347 Local HTTP command bridge, for example http://127.0.0.1:10347/exec?cmd=run&path=...
autojs6.adb.path Empty Path to the adb executable or its directory; an empty value enables autodetection
autojs6.discovery.enabled true Discover AutoJs6 6.8.0+ devices running server mode through mDNS (_autojs6._tcp) when connecting over LAN
autojs6.connection.connectTimeout / handshakeTimeout 8000 / 6000 Connection and handshake timeouts in milliseconds
autojs6.connection.heartbeatInterval / heartbeatTimeout 15000 / 10000 Heartbeat interval and timeout in milliseconds; interval 0 disables heartbeats
autojs6.connection.autoReconnect / maxReconnectAttempts true / 0 Reconnect unexpected disconnections of extension-initiated connections; 0 attempts means unlimited
autojs6.connection.reconnectTimeout / reconnectMaxDelay 300 / 10000 Reconnection-session window in seconds (0 means unlimited) and maximum backoff in milliseconds
autojs6.connection.restoreOnStartup true Restore the last successful device connection at VSCode startup, except explicit disconnections
autojs6.log.showChannelOnConnect true Show the log panel automatically when a device connects
autojs6.log.disposeChannelOnDisconnect false Remove the log panel when a device disconnects
autojs6.log.debug false Record extension debug logs
autojs6.save.keepRelativePath true Preserve workspace-relative directories when saving files (AutoJs6 6.8.0+)

See protocol.md for the communication protocol.


Related projects


Changelog

v1.1.0

2026/09/16
  • Feature The "AutoJs6" activity-bar view contains a "Devices (Devices)" list and "Device Files (Device Files)" tree for browsing, opening, editing, uploading, downloading, renaming and deleting device files and running scripts (requires AutoJs6 6.8.0+)
  • Feature Upload multiple local folders from the device-files view, preserving subdirectories and empty directories, merging matching directories and overwriting matching files, with progress and cancellation
  • Feature The autojs6fs:// remote filesystem opens device files directly in the editor and saves them back; "Browse Device Files" adds a device directory to the workspace
  • Feature QR connections: "Server | QR Code" displays this computer's connection code, and AutoJs6 6.8.0+ client mode connects after scanning issue #12
  • Feature Protocol v2: application-level heartbeats (ping/pong) detect half-open connections; extension-initiated LAN/ADB connections reconnect after unexpected disconnection issue #3 issue #13
  • Feature Reconnection sessions use exponential backoff after unexpected disconnection, for 5 minutes by default with configurable attempts/window/maximum interval; VSCode restores the last connection after restarting (autojs6.connection.restoreOnStartup). Add "Reconnect last device (Reconnect)" and "Stop automatic reconnection (Cancel Reconnect)", with status-bar progress
  • Feature Disconnection notice bye: either side informs the peer of explicit disconnection, preventing reconnection and startup restoration; VSCode sends bye(shutdown) on shutdown so AutoJs6 (6.8.0+) can reconnect later
  • Feature Pairing confirmation offers "Allow and remember / Allow once / Deny" for unknown client-mode devices; QR connections use a one-time token for automatic trust. Add "Manage trusted devices (Manage Trusted Devices)" and autojs6.server.confirmUnknownDevices; AutoJs6 6.8.0+ shows "Waiting for VSCode confirmation"
  • Feature LAN discovery (mDNS): "Client | LAN" automatically lists AutoJs6 6.8.0+ devices with server mode and LAN discovery enabled; disable with autojs6.discovery.enabled
  • Feature Large transfers split reads/writes exceeding 1 MiB into 1 MiB chunks, with cancellable progress (AutoJs6 6.8.0+)
  • Feature "Pull project changes from device (Pull Project from Device)" compares the device copy to the local project, lists added/modified files, previews per-file diffs and pulls selected changes (AutoJs6 6.8.0+ compares md5 from fs.list; older versions compare contents)
  • Feature Localization follows the VSCode display language (Simplified Chinese / English), including command titles and setting descriptions (vscode.l10n)
  • Feature Status-bar device indicator for quickly selecting run, save, logs or disconnect actions
  • Feature Settings (autojs6.*) cover listening ports, HTTP command-service address/port, adb path, connection/handshake/heartbeat timeouts, reconnection, log panels and relative save paths
  • Feature Connection addresses accept hostnames and custom ports (host:port, [ipv6]:port) issue #20
  • Feature "Resynchronize entire project (Resync Project)" forces a complete overwrite of the device project issue #29
  • Fix Fix activation failures when port 6347/10347 is occupied, such as with multiple VSCode windows, causing all commands to report "not found" issue #14 issue #15
  • Fix Fix device discovery on Linux / macOS when parsing adb devices with Windows line endings; add adb autodetection (ANDROID_HOME, ANDROID_SDK_ROOT, common installation paths) and autojs6.adb.path issue #35
  • Fix Fix the inverted override flag during incremental sync and failed device deletion when deletedFiles contains backslashes on Windows (requires matching AutoJs6 6.8.0+) issue #29
  • Fix Fix "Stop current script" and "Save" selecting the wrong editor when focus is in the output panel
  • Fix Fix exceptions from accessing disposed connections after handshake timeout or disconnection
  • Fix Handle output panels after device disconnection: retain and mark them disconnected by default, or remove automatically with autojs6.log.disposeChannelOnDisconnect issue #30
  • Fix Remove port forwarding when an ADB connection closes
  • Fix Fix occasional false "Cannot reconnect ..., stopped retrying" messages after unexpected disconnection (previously stopped after 5 attempts, about 31 s); show failure once at the end of the reconnection window with "Retry" / "Do not restore automatically"
  • Improvement Include workspace-relative paths when saving/running files; AutoJs6 6.8.0+ preserves the directory structure in its working directory issue #37
  • Improvement The HTTP command service listens only on 127.0.0.1 by default (previously 0.0.0.0), preventing other LAN hosts from invoking local commands
  • Improvement Filter virtual interfaces such as Hyper-V / VirtualBox / Docker / WSL, and prioritize the default-gateway interface issue #12
  • Improvement Reduce QR-code density through a shorter payload and lower error correction, and add a size slider to help AutoJs6 focus when scanning
  • Improvement Skip ignore directories such as node_modules directly during project traversal and remove full-package byte debug dumps
  • Improvement Separate protocol/device/UI/remote-file/QR modules and add pure Node.js unit tests (npm test)
  • Improvement Bundle with esbuild, reducing vsix from 9.6 MB to about 1 MB; replace pinyin / systeminformation with tiny-pinyin and system routing-table discovery
  • Improvement Add port explanations and the protocol.md protocol document to README issue #10

v1.0.13

2026/03/14
  • Improvement Refactor device-side Socket framing: replace text headers with a fixed 8-byte binary header (int32BE length + type)
  • Improvement Parse TCP streams with a cumulative-buffer frame loop for reliable partial and concatenated frames
  • Improvement Validate frame types and maximum lengths to detect protocol desynchronization early and prevent abnormal memory growth
  • Improvement Remove unnecessary string intermediates when sending JSON and binary data

v1.0.12

2025/04/14
  • Fix Fix server-mode connection failures caused by incorrect version checks issue #27
  • Improvement New projects can use the dts-link script task to create a symlink to AutoJs6 declarations automatically issue #8

Full changelog

Multilingual documentation

Edit the language JSON and templates in .readme/ and .changelog/, then regenerate the documents. Do not edit generated Markdown directly. The root README uses Simplified Chinese. These commands require Python 3.10 or newer without extra Python packages; Windows can use py instead of python. --check validates languages, fields, historical versions and dates, punctuation, and generated files without writing. CI runs the same check.

python .python/generate_markdown.py
python .python/generate_markdown.py --check
python -m unittest discover -s .python/tests

Explore related projects

Loading…