preface

AutoJs Web Control is based on NodeJS typescript Vuejs and other front-end language development, can achieve Android mobile phone root-free group Control system, this article describes in detail how to compile and deploy AutoJs Web Control.

Open source document

  • Autojs official documentation

  • Autojs source

  • Autojs Web Control

    AutoJs Web Control is divided into two parts, Web is the user operation interface, server is the server, respectively compiled and transmitted to the server deployment start.

Environmental requirements

  1. nodejs
  2. Webstorm [other development tools are also available, I’m using WebStorm here]
  3. git
  4. mysql

Environment set up

Database environment
  1. Create a new database with whatever name you like, autojs_control in this case

  2. Importing database Scripts

    File Location:

    autojs-web-control/cloud_auto.sql

    autojs-web-control/update.sql

Import the source code
  1. Use Git to pull the source code

    Git clone github.com/zrk1993/aut…

  2. Import Webstorm

  3. Modifying database Connections

    File Location:

    autojs-web-control\server\utils\db.ts

Deploying the server
  1. Go to the autojs-web-control/server/ directory

  2. Run NPM install to generate the node_modules directory

  3. Modify the output directory of compiled files,

    autojs-web-control\server\tsconfig.json

    "OutDir ": "./" Adjust to "outDir": "./dest"Copy the code
  4. Run NPM run build to compile

  5. Add the start command script

    "scripts": {
     "build": "tsc -p tsconfig.build.json"."clean": "ts-clean"."lint": "tslint --fix -p tsconfig.json -c tslint.json"."start": "node ./modules/default/main.js"
    }
    Copy the code
  6. Deploy and start

    • Create a folder autojs_server

    • Copy all directories in modules node_modules package.json dest to autojs_server

    • Run the NPM start command to start the server

Deploy the Web side
  1. Go to the autojs-web-control/web/ directory

  2. Run the NPM install command to install the file

  3. Install the vue

    npm install -g @vue/cli

    vue add unit-jest

  4. Edit the autojs-web-control\web\. Env. staging file to change the server connection address (optional for the same server)

    NODE_ENV = production
    
    # just a flag
    ENV = 'staging'
    
    # base api
    VUE_APP_BASE_API = 'http://localhost:9317'VUE_APP_WS_HOST ='ws://localhost:9317'Change to the server IP addressCopy the code
  5. For example, run NPM run dev on the local PC to start the Web program. You can skip the subsequent step to publish the web program to the server

  6. Run NPM run build:stage to generate the dest directory

    This step is optional. For example, run NPM run dev on the local PC to start the web program. Follow-up steps are not required

  7. Copy the dest directory file to the server and publish it.

Verify release
  1. Visit http://localhost:9528 to access the landing page

    The default user name is admin

    Default password: 123456

    Both the user name and password can be changed in the autojs_control.t_admin database

  2. You can select devices and execute scripts

conclusion

The above is the entire process of Autojs Web Control deployment. If you have any questions or exchanges, please feel free to comment @me.