Giter Club home page Giter Club logo

autojs6-vscode-extension's Introduction

autojs6-vscode-ext-banner_1024×310

AutoJs6 (AutoJs6 调试工具 (VSCode 插件)

Debugger for AutoJs6 on VSCode

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


AutoJs6 VSCode 开发插件



安装 (Install)


  • VSCode 菜单 View / 查看 - Extensions / 扩展 [ Ctrl+Shift+X ]
  • 搜索 "AutoJs6" 或 "003"
  • 选择 "AutoJs6 VSCode Extension" 插件并安装 (或更新)

功能 (Features)


  • 在 VSCode 中连接设备并操作 AutoJs6 的脚本或项目 (运行 / 停止 / 保存 等)
  • 在 VSCode 中实时显示 AutoJs6 的日志

使用 (Usage)


  1. 基本操作
  • < 命令面板 >
    • VSCode 菜单 View / 查看 - Command Palette / 命令面板 [ Ctrl+Shift+P ]
  • < 开发人员工具 >
    • VSCode 菜单 Help / 帮助 - Toggle Developer Tools / 切换开发人员工具
  1. 连接到计算机
  • 打开 < 命令面板 > 选择 AutoJs6: 建立设备连接 (Connect) [ Ctrl+Alt+F6 ]
  • 使用下述方式之一建立设备连接 (任选其一)
    • AutoJs6 (客户端) > VSCode (服务端) | 局域网
      • AutoJs6 侧拉菜单中开启 "客户端模式"
      • 输入 VSCode 弹窗显示的本机 IP 地址
    • AutoJs6 (服务端) < VSCode (客户端) | 局域网
      • AutoJs6 侧拉菜单中开启 "服务端模式"
      • VSCode 输入 AutoJs6 所在设备的 IP 地址
    • AutoJs6 (服务端) < VSCode (客户端) | ADB (USB)
      • AutoJs6 侧拉菜单中开启 "服务端模式"
      • AutoJs6 所在设备通过 USB 连接到 VSCode 所在计算机
      • AutoJs6 所在设备需启用 USB 调试模式并勾选信任上述计算机
      • 不同设备操作方式可能不同 详见设备厂商手册或相关互联网资料
    • 历史记录 (IP)
      • 连接成功后的设备 IP 地址会记录在列表中方便选择
      • AutoJs6 需启用 "服务端模式"
      • 设备 IP 地址可能发生改变
      • 使用 "清理" 选项清除所有已保存的记录
  • VSCode 弹窗显示 AutoJs6 设备接入: ${DEVICE} (${IP_ADDRESS}) 完成设备连接
  1. 执行命令
  • 打开 < 命令面板 > 查看并执行支持的命令 (快捷键详见下述 "命令" 板块)
  • AutoJs6: 运行脚本 (Run) AutoJs6: 停止所有脚本 (Stop All)
  1. 查看日志
  • 采用下述方式之一查看来自 AutoJs6 的日志 (任选其一)
    • 在建立设备连接后弹出的 OUTPUT / 输出 面板 [ F12 ] 查看
    • 打开 < 开发人员工具 >Console 面板查看
  1. 断开连接
  • 采用下述方式之一断开所有 AutoJs6 与 VSCode 建立的连接 (任选其一)
    • 打开 < 命令面板 > 选择 AutoJs6: 断开所有连接 (Disconnect All) [ Ctrl+Alt+Shift+F6 ]
    • 在 AutoJs6 侧拉菜单关闭对应开关 (客服端 / 服务端)
    • 断开 AutoJs6 的 USB 连接 (仅适用于 ADB (USB) 连接方式)
    • 退出 AutoJs6 应用 / 关闭 VSCode 软件

命令 (Commands)


  • 查看在线文档 (View Online Document) [ Alt+Shift+F6 ]
    • 查看 AutoJs6 在线开发文档
  • 建立设备连接 (Connect) [ Ctrl+Alt+F6 ]
    • 建立 AutoJs6 与 VSCode 的连接
    • AutoJs6 相关开关可能需要手动开启
  • 断开所有连接 (Disconnect All) [ Ctrl+Alt+Shift+F6 ]
    • 断开所有已建立的连接
    • AutoJs6 相关开关状态可能被重置
  • 运行脚本 (Run) [ F6 ]
    • 运行当前 VSCode 对应的脚本
    • 对所有已连接的设备有效
  • 重新运行脚本 (Rerun)
    • 停止当前 VSCode 对应的脚本并重新运行
    • 对所有已连接的设备有效
  • 停止当前脚本 (Stop) [ Ctrl+F6 ]
    • 停止当前 VSCode 对应的脚本
    • 对所有已连接的设备有效
  • 停止所有脚本 (Stop All) [ Ctrl+Shift+F6 ]
    • 停止所有正在运行的脚本
    • 对所有已连接的设备有效
  • 保存到所有设备 (Save)
    • 保存当前文件到已连接设备的 AutoJs6 工作目录
    • 对所有已连接的设备有效
  • 指定设备运行 (Run On Device)
    • 弹出设备菜单并指定运行 VSCode 对应脚本的设备
  • 保存到指定设备 (Save To Device)
    • 弹出设备菜单并在指定保存 VSCode 对应脚本的设备
  • 新建项目 (New Project) [ CTRL+ALT+6 N ]
    • 选择 (或创建后选择) 一个空文件夹用于新建 AutoJs6 项目
    • 新建项目后执行 npm installnpm run dts 可完成声明文件部署
  • 运行项目 (Run Project) [ CTRL+ALT+6 R / Alt+F6 ]
    • 运行一个 AutoJs6 项目
  • 保存项目到设备 (Save Project) [ CTRL+ALT+6 S ]
    • 保存一个 AutoJs6 项目

版本历史 (Release Notes)


v1.0.9

2023/11/15
  • 修复 执行 npm install 可能出现 Not Found 的问题 issue #1
  • 修复 新建项目时存在目录时可能出现文件遗漏复制的问题
  • 优化 新建项目后执行 npm install 或 npm run dts 可完成声明文件部署

v1.0.8

2023/10/31
  • 修复 执行任何命令均无效的问题

v1.0.7

2023/10/30
  • 修复 输入 AutoJs6 服务端地址有效且部分匹配历史记录时无法按输入值建立连接的问题
  • 优化 增加 AutoJs6 项目实例的必要文件检测及提示
  • 优化 未命名文件保存到设备时自动识别文件类型并添加扩展名
更多版本历史可参阅

相关项目


autojs6-vscode-extension's People

Contributors

supermonster003 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

autojs6-vscode-extension's Issues

当扩展更新至v1.0.7时执行插件命令报错

在命令面板执行命令扩展autojs6所涉及的命令时都会报错 "not found"
比如执行建立设备连接命令时报以下错误
command 'extension.connect' not found
本人将插件回溯至v.1.0.6时问题消失且本人的安卓端autojs6版本已更新至最新版v.6.4.

运行项目没反应?

image

image

环境 aujs6.0.3
插件 AutoJs6 (Auto.js v6.x) VSCode Extension v1.0.4
日志也没有看到一点输出

运行脚本则是正常的。

Raise Unknown Type Issue

When running the script or saving the script to the pad, the following issue is raised.
java.lang.Exception: Unknown data type (0) for message dispatching

Plugin Version: v1.0.5
Autojs6 Version: 6.3.2
Issue Description:
java.lang.Exception: Unknown data type (10) for message dispatching
at org.autojs.autojs.runtime.ScriptRuntime.popException(ScriptRuntime.java:84)
at org.autojs.autojs.pluginclient.JsonSocket.onMessageDispatch(JsonSocket.java:221)
at org.autojs.autojs.pluginclient.JsonSocket.lambda$monitorMessage$0(JsonSocket.java:331)
at org.autojs.autojs.pluginclient.JsonSocket.$r8$lambda$va2cxRhe8N9XY6l6jBcuYwu6HoA(Unknown Source:0)
at org.autojs.autojs.pluginclient.JsonSocket$$ExternalSyntheticLambda0.run(Unknown Source:6)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)
16:04:05.159/E: Unknown data type (0) for message dispatching

可以增加一下快捷操作和右键功能菜单么

可以在文件夹或文件增加右键快捷菜单吗?
能不能提出部分快捷功能到菜单栏(分屏编辑位置),便于快捷操作,比如开启服务器模式,adb 链接,保存项目,运行项目,运行文件等高频使用场景?
谢谢!

[功能建议] 新建项目时自动创建declarations软连接

VScode中每新建一个项目都要复制一份declarations有点麻烦,希望在用扩展新建项目时可以自动创建软连接,这样就不用复制那么多了,而且declarations有更新时也更方便。
Windows下 创建软连接已经测试过可以用的,命令类似下面的:
mklink /D D:\项目目录\declarations C:\Users\用户名\node_modules\@sm003\autojs6-dts\declarations

V1.0.9 ADB无法连接

image

  • 手机端已打开USB调试
  • 按照本插件提示的如下教程,已正确配置好电脑端的ADB工具
    ADB工具连接Android手机
  • 按照教程中的内容,使用adb命令行可以连接到手机。执行测试返回键命令(adb shell input keyevent 4),手机可以动作。
  • 使用master下的tools目录中的adb,也同样无法连接。
  • 电脑防火墙,已关闭
  • 服务端模式 和 客户端模式,也都无法连接

关于远程连接服务的一些小BUG

  1. 建立了错误的ip指向BUG。

电脑上装有VMware虚拟机的时候,使用VSCode建立的连接,ip会受到虚拟网络适配器的影响,没有使用实际可用的ip地址。
比如说,正常建立的连接ip地址应该是:192.168.1.xxx 或 192.168.2.xxx 结果却变成了 192.168.189.x (总之就是app不能正常连接)
虽然手动停掉虚拟机的网络适配器可以解决这个问题,但挺麻烦的。希望可以解决一下这个BUG

  1. 建立连接的描述较难看懂。

话说第一次使用插件建立连接时,看到以下弹出来的选项还挺懵逼的。

[连接] - Autols6(客户端) > VSCode (服务端)|局域网
AutoJs6作为客户端主动连接VSCode (使用IP地址)

[连接] - AutoJs6 (服务端) < VSCode (客户端)|局域网
VSCode主动连接作为服务端的 AutoJs6 (使用IP地址)

[连接] - AutoJs6(服务端) < VSCode (客户端)|ADB (USB)
VSCode主动连接作为服务端的AutoJs6 (使用USB线览)

或许可以改成?

[连接] - 服务端模式 | 局域网
VSCode作为服务端,提供给AutoJs6的客户端模式接入 (使用IP地址)

[连接] - 客户端模式 | 局域网
VSCode作为客户端,主动接入到AutoJs6的服务端模式 (使用IP地址)

[连接] - 客户端模式 | ADB (USB)
VSCode作为客户端,主动接入到AutoJs6的服务端模式 (使用USB线览)

AutoJs6 侧拉菜单在哪里

当建立设备连接时, 需在·AutoJs6 侧拉菜单中开启 "客户端模式"或“服务端模式”。 请问这个侧拉菜单在VSCODE 的哪里呀? 我怎么找不到。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.