Tooth uncle tutorial is easy to understand

Autojs Log type

  • Temporary log of the hover window console
  • Console for the console TAB in the UI
  • Console for the GlobalConsole TAB in the UI
  • Click the Log button in the upper right corner for permanent log

The following describes the display and clearing of these types of logs

The environment

Phone: Mi 11 Pro

Android version: 11

Autojs version: 9.0.10

Suspension window log

  • According to the log
console.show();
Copy the code
  • Clear the log
console.clear();
Copy the code

Console for the console TAB in the UI

  • According to the log
"ui";
ui.layout(
  <vertical>
    <button id="clearLog">清空日志</button>
    <console id="console" w="*" h="*" bg="#ff0000"></console>
  </vertical>
);
ui.console.setConsole(runtime.console);
ui.console.setInputEnabled(false);
for (var i = 0; i < 10; i++) {
  log(("" + i).repeat(10));
}
Copy the code
  • Clear the log
ui.clearLog.click(function () {
  console.clear();
});
Copy the code

Console for the GlobalConsole TAB in the UI

  • According to the log
"ui"; UI. Layout (<vertical> <button ID ="clearLog"> </button> < globalConsole ID ="console" w="*" h="*" bg="#ff0000"></globalconsole> </vertical> ); for (var i = 0; i < 10; i++) { log(("" + i).repeat(10)); }Copy the code
  • Clear the log
ui.clearLog.click(function () {
  console.clear();
});
Copy the code

Click the Log button in the upper right corner for permanent log

  • According to the log
Click the log button in the upper right cornerCopy the code
  • Clear the log
files.write(console.getGlobalLogConfig().file, "");
Copy the code

Quotes.

Ideas are the most important, other Baidu, Bing, StackOverflow, Github, Android docs, AutoJS docs, and last but not least, ask in the group

The statement

This tutorial is intended for learning purposes only and is not intended for any other use