当前位置:网站首页>APP application related instructions in Auto.js

APP application related instructions in Auto.js

2022-08-10 20:56:00 aiguangyuan

1. APP version command

1. The current application version number;

app.versionCode

2. The name of the current application version;

app.versionName

3. The current Auto.js version number;

app.autojs.versionCode

4. The name of the current Auto.js version;

app.autojs.versionName

2. Command to open APP

1. Open the app by the app name;

app.launch(appName)

This function can also be used as a global function:

launch(appName)

2. Open the APP through the APP package name;

app.launchPackage(packageName)

This function can also be used as a global function:

launch(packageName)

3. Get the name of the installed application corresponding to the application package name, and return null if the application cannot be found;

app.getAppName(packageName)

This function can also be used as a global function:

getAppName(packageName)

4. Get the package name of the installed application corresponding to the application name, if the application cannot be found, return null, if the name corresponds to multiple applications, only return the package name of one of them;

app.getPackageName(appName)

This function can also be used as a global function:

getPackageName(appName)

3. View and edit files

1. Use other applications to view the file, if the file does not exist, it will be handled by the application viewing the file;

app.viewFile(path)

2. Use other applications to edit the file, if the file does not exist, it will be processed by the application that edited the file;

app.editFile(path)

4. APP installation and uninstallation

1. Uninstall the app. After execution, a prompt box to uninstall the app will pop up.If the application of the package name is not installed, it will be processed by the application uninstaller, and a prompt "application not found" may pop up;

app.uninstall(packageName)

2. Install the application;

app.viewFile(apkPath)

5. Different jump methods

1. Open the application information interface of the application, if the application cannot be found, return false, otherwise return true;

app.openAppSetting(packageName)

This function can also be used as a global function:

openAppSetting(packageName)

2. Start the specific interface of Auto.js, if the function runs in Auto.js, it will open the interface in Auto.js, and if it runs in the packaged application, it will open the corresponding interface of the packaged application;

app.startActivity(name)

The value of name has the following two options:

(1). Log interface: console;

(2). Setting interface: settings;

3. Open the link with the default browser;

app.openUrl(url)

4. Automatically send emails;

app.sendEmail(options)

options is an object, that is, parameters for sending emails, including the following attributes:

(1). email: {string} | {Array}

The recipient's email address, or an array of strings if there are multiple recipients.

(2).cc: {string} | {Array}

The email address of the cc recipient, if there are multiple cc recipients, it will be represented by a string array.

(3).bcc:{string} | {Array}

The email address of the blind copy recipient, if there are multiple blind copy recipients, it will be represented by a string array.

(4).subject:{string}

The subject of the email.

(5).text:{string}

The body of the message.

(6).attachment:{string}

The path to the attachment.

// Email [email protected] and [email protected]({email: ["[email protected]", "[email protected]"],subject: "This is the subject of the email",text: "This is the message body"});

原网站

版权声明
本文为[aiguangyuan]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/222/202208102024550037.html