M8Test Help

脚本命令

M8Test 支持通过命令来管理脚本。如您尚不清楚如何使用命令,请参考 命令 章节。

启动字符串脚本

script start string --name hi.py --language name=Python,version=0.1.0,url=https://github.com/m8test/language-release/releases/download/python-0.1.0/com.m8test.python-arm64-v8a-release_0.1.0.apk --content _console.log(132)
  • script start string: 启动字符串脚本

  • --name hi.py: 指定脚本名称为 hi.py

  • --language name=Python,version=0.1.0,url=https://github.com/m8test/language-release/releases/download/python-0.1.0/com.m8test.python-arm64-v8a-release_0.1.0.apk: 指定执行该字符串脚本所需的语言插件

    • name=Python: 指定语言插件名称为 Python

    • version=0.1.0: 指定语言插件版本为 0.1.0

    • url=https://github.com/...: 若指定名称和版本的插件不存在,将从该 URL 下载

  • --content _console.log(132): 指定要运行的脚本内容

中断字符串脚本

script interrupt string --name hi.py
  • script interrupt string: 中断字符串脚本

  • --name hi.py: 指定要中断的脚本名称为 hi.py

启动文件脚本

script start file --path /path/to/script --url https://www.example.com/xxx.yyy
  • script start file: 启动文件脚本

  • --path /path/to/script: 指定本地脚本文件的路径

  • --url https://www.example.com/xxx.yyy: 若本地文件不存在,将从该地址下载并保存到 --path 指定的位置后再启动

中断文件脚本

script interrupt file --path /path/to/script
  • script interrupt file: 中断文件脚本

  • --path /path/to/script: 指定要中断的本地文件脚本路径

启动项目脚本

script start project --path /path/to/script --url https://www.example.com/xxx.yyy
  • script start project: 启动项目脚本

  • --path /path/to/script: 指定本地项目脚本路径

  • --url https://www.example.com/xxx.yyy: 若本地项目不存在,将从该地址下载并保存到 --path 指定的位置后再启动

中断项目脚本

script interrupt project --path /path/to/script
  • script interrupt project: 中断项目脚本

  • --path /path/to/script: 指定要中断的本地项目脚本路径

启动脚本时指定组件(可选)

script start xxx --component name=xxx,version=yyy,url=https://zzz --component name=aaa,version=bbb,url=https://ccc ...
  • xxx: 可为 stringfileproject

  • --component name=xxx,version=yyy,url=https://zzz: 添加名为 xxx、版本为 yyy 的组件,若不存在则从指定 URL 下载

  • --component name=aaa,version=bbb,url=https://ccc: 同理,添加另一个组件

  • ...: 其他命令选项,例如启动字符串脚本时的 --name ,文件脚本时的 --path ,当然也可继续添加更多组件

启动脚本时指定参数(可选)

script start xxx --argument yyy --argument zzz ...
  • xxx: 可为 stringfileproject

  • --argument yyy: 添加参数 yyy 作为脚本启动参数

  • --argument zzz: 添加参数 zzz 作为脚本启动参数

  • ...: 其他命令选项,例如启动字符串脚本时的 --name 、文件脚本时的 --path ,也可继续添加更多启动参数

Last modified: 12 June 2025