Skip to content

terwer/AutoJs6-JetBrains

Repository files navigation

Stars License Release Kotlin IntelliJ Platform JVM 21

Docs AutoJs6 Version

AutoJs6 JetBrains Plugin

A JetBrains IDE plugin for AutoJs6.Connect Android devices in IntelliJ IDEA, WebStorm, PyCharm, and the full JetBrains IDE family. Run, save, and stop scripts with one click, and scaffold AutoJs6 projects from a built-in template.

English | 简体中文


✨ Features

Feature Description
🔌 Multi-mode Connection IDE listener (port 6347), direct IP (port 7347), and ADB — three ways to connect your AutoJs6 devices
▶️ Run Script Run the currently open script on all connected devices with a single shortcut
▶️ AutoJs6 Script / Project Run Configurations Save and rerun one local .js file or an AutoJs6 project with project.json through JetBrains Run Configurations, the green Run button, recent runs, and Shift + F10
💾 Save to Device Push the current script to all connected devices
⏹️ Stop Script Stop the current script or all running scripts at once
📁 Project Template Scaffold a new AutoJs6 project from the built-in AutoJs6 template
📖 Online Docs Jump to docs.autojs6.com directly from the IDE
⌨️ Keyboard-first Full keyboard shortcut support — stay in the flow without leaving your IDE

🚀 Quick Start

Prerequisites

  • JetBrains IDE — IntelliJ IDEA / WebStorm / PyCharm / any JetBrains IDE (build 242+)
  • JDK 21+
  • AutoJs6 App — version ≥ 6.7.0 (version code ≥ 3591) installed on your Android device
  • Device and computer on the same network (for IP/listener mode) or connected via USB + ADB

Installation

# Clone and build the plugin
git clone https://github.com/terwer/AutoJs6-JetBrains.git
cd AutoJs6-JetBrains
./gradlew buildPlugin

The built plugin zip will be in build/distributions/. Install it via:

Settings → Plugins → ⚙️ → Install Plugin from Disk...

Connect Your Device

  1. Open the Tools → AutoJs6 menu (or use shortcuts below)
  2. Choose a connection method:
    • IDE Listener — starts a server on port 6347; AutoJs6 app connects to your IDE
    • IP Connect — enter the device's IP; IDE connects to AutoJs6 server on port 7347
    • ADB Connect — select a USB-connected device from the ADB device list

Run a Script

  1. Open any .js file in the editor
  2. Press F6 — the script runs on all connected devices instantly

Run a Saved Script Configuration

  1. Open Run → Edit Configurations...
  2. Add AutoJs6 Script
  3. Select one local .js file
  4. Run it from the green Run button, recent runs, or Shift + F10

AutoJs6 Script and AutoJs6 Project are real JetBrains Run Configurations. VSCode-parity project actions (Run Project / Save Project) are also exposed as AutoJs6 actions; they resolve project.json, build a project diff zip, calculate md5, send bytes first, and then send the JSON bytes_command.

⌨️ Keyboard Shortcuts

Action Shortcut
Connect Device Ctrl + Alt + F6
Disconnect All Ctrl + Alt + Shift + F6
Run Current Script F6
Stop Current Script Ctrl + F6
Stop All Scripts Ctrl + Shift + F6
New AutoJs6 Project Ctrl + Alt + 6, then N

🏗️ Architecture

org.autojs.autojs6.jetbrains
├── actions    # IDE Actions — UI entry points for all user commands
├── adb        # ADB integration — device discovery and port forwarding
├── device     # Core networking — socket connections and binary protocol
├── project    # Project scaffolding — template-based project creation
├── run        # JetBrains Run Configuration for a single AutoJs6 script file
└── script     # Shared single-file command payload and validation helpers

Protocol

The plugin uses a custom binary framing protocol over TCP:

Component Detail
Frame Header 8 bytes
Payload Types 1 = JSON, 2 = Bytes
Max Frame Size 64 MB
Handshake Bidirectional hello with version negotiation
Min App Version 6.7.0 (code 3591) — connection is rejected below this

Ports

Port Purpose
6347 IDE Listener — IDE accepts incoming device connections
7347 Server — AutoJs6 app listens for IDE connections
10347 HTTP Server
20347 ADB Server

🛠️ Development

# Run the plugin in a sandbox IDE instance
./gradlew runIde

# Build the plugin distribution
./gradlew buildPlugin

# Run tests
./gradlew test

# Verify plugin compatibility across IDE versions
./gradlew verifyPlugin

Tech Stack

Technology Version
Kotlin 2.0.21
IntelliJ Platform 2024.2 (IC)
IntelliJ Platform Gradle Plugin 2.2.1
JVM Toolchain 21
Build System Gradle with Kotlin DSL

📋 Compatibility

  • ✅ Designed for the full JetBrains IDE family (IntelliJ IDEA, WebStorm, PyCharm, GoLand, Rider, CLion, DataGrip, etc.; build 242+) — release claims follow docs/release-compatibility-matrix.md
  • ✅ AutoJs6 app version ≥ 6.7.0
  • ✅ Windows / macOS / Linux (ADB bundled for Windows)
  • ✅ Parity with the AutoJs6 VSCode extension workflow

📖 Documentation

Full AutoJs6 documentation is available at docs.autojs6.com.

Access it directly from the IDE via Tools → AutoJs6 → View Online Document.

Release and Marketplace publishing steps are documented in docs/release-guide.md.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the GNU General Public License v3.0 — see the LICENSE file for details.

🔗 Related Projects

About

JetBrains IDE plugin for AutoJs6.Connect Android devices in IntelliJ IDEA, WebStorm, PyCharm, and the full JetBrains IDE family. Run, save, and stop scripts with one click, and scaffold AutoJs6 projects from a built-in template.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors