Auto.js study notes 16: Save to your phone by project, no need to save a single js file every time, convenient for debugging and packaging

Table of contents

Introduction

Save the entire project to the specified device

Create project

Pack

Summarize



Introduction

Using Auto.js version 7.0.4.1 Pro

We just learned that we usually use one js file to write code. However, as the project functions increase, the code becomes bloated, resulting in serious coupling between business code, technical code and other codes. In this way, multiple js files must be used. js file reference:Auto.js study notes 7:js

Save the entire project to the specified device

This kind of operation undoubtedly facilitates debugging and saves time. You don't need to save other js files one by one to the device every time you modify them. It also avoids the situation where you forget to save the tool js file after modifying it, causing the project to report an error.

Create project

1. Create a project in VS Code, such as Project A. The project I created using the non-Pro version command, Ctrl+Shift+P, is Auto.js: New Project

2. Create a project on auto Pro and copy project.json to the root directory of project A, as shown in Figure 3.

3. Modify the name of the main main.js file in the autoPro project to the name of the main js file of your project, such as MyMain.js.

4. Panel command: Ctrl+Shift+P, save the project to the device, as shown in Figure 4. This way you will find it really convenient, as you don’t have to save a single js file each time.

image 3
Figure 4

Pack

Packaging is very convenient. Just click on the Android robot on autoPro to perform the packaging operation.

Summarize

The importance of learning, the more you learn, the more convenient it will be for you, and you will find that the previous method was to spend more time.

Just watching and typing is useless
After reading, you must practice it
You must type the code
Be sure to run trial and error
This is meaningful learning

Guess you like

Origin blog.csdn.net/piyangbo/article/details/125478812