Android Lua Helper README
Android LuaHelper is a High-performance lua plugin, Language Server Protocol for lua, Support Android management.
Statement
- It is strictly prohibited to use this tool to develop software and applications for the black market and gray market industries, such as Wuhan Luke Software Technology Co., Ltd. and its affiliated entities or individuals. Any consequences arising therefrom shall be borne by the user. In addition, any issues arising from legal matters or regulatory matters are not related to this plug-in and its developers in any way.
- 严禁使用本工具为黑市及灰色产业开发软件和应用程序,所涉范围包括但不限于武汉路客软件科技有限公司及其关联实体和个人。若有违反,由此产生的一切后果均由用户自行承担。此外,因法律问题或监管事项产生的任何问题均与本插件及其开发人员毫无关联。
Introduction
Lua is very popular in game development because of its simple syntax and flexible use.
Feature
Code Editing
- local and global file definition query jump
- reference lookup of various types based on scope
- automatic completion for variables and functions
- code formatting
- code hover prompts
- global variable highlighting shading
Visual Editor
an jian jing ling's LuaAuxLib
for image editor
- excel & csv editor & preview
- csv rainbow columns
Code Detection
- Syntax Check
- Semantic Check
- Quick Analysis
Debugger
- Debug Attach To Remote Android Lua App
- Zip project files to remote Android device
Android Manager
- adb connect
- install & uninstall apk
- grant & revoke all app user permissions
- show & filter logcat
Use Debugger
The debugger is a powerful tool that allows developers to debug Lua code in real time. It provides a variety of debugging functions, such as breakpoints, variable inspection, and step-by-step execution.
Create launch.json file
After installing the Android Lua Helper
plugin, click the Run
button, then click to create launch.json
. When choosing the debugger, we should select AndroidLuaHelper: Debug
. This process is like building a bridge for our debugging journey. It provides a basic configuration framework for subsequent debugging work and ensures that we can debug Lua code smoothly.
In the launch.json
file, we add the following content:
- The
connectionPort
field is used to specify the debugging port, which defaults to 8818
.
- The
stopOnEntry
field is particularly crucial. Setting it to false can avoid breakpoints at the program entry point, making the debugging process more smooth. For example, in some complex projects, if stopOnEntry
is true
, it may cause the debugging process to be interrupted at the very beginning, making it difficult to quickly locate the actual problem point. By setting it to false, we can control the starting point of debugging more flexibly and improve debugging efficiency.
- The
enableRemotePath
field is used to determine whether to enable the remote path, which defaults to true
.
- The
remotePath
field is used to specify the remote path, which defaults to /sdcard/Download/script.zip
. The local project files will be packaged into a zip file and uploaded to this directory on the phone. The APP needs to load the scripts in this directory for decompression, then run and debug.
Add the LuaPanda.lua
file to the project
Press the shortcut keys Ctrl+Shift+P, enter AndroidLuaHelper: Copy Debug file
, and then press Enter.
After selecting the appropriate project directory, the LuaPanda.lua
file will be automatically copied to the directory and named LuaPanda.lua
.
Insert debugging code into the appropriate file
In an appropriate file (such as main.lua
), press the shortcut keys Ctrl+Shift+P, enter AndroidLuaHelper: Insert Debugger Code
, and then press Enter.
Insert the following code:
The default port is 8818
, which should be consistent with the connectionPort
in the launch.json
file.
Connect to an Android phone
Android Lua Helper
will automatically detect the phone. If it cannot be detected, manual input is required.
Click the Android
button on the sidebar, then click the Input Device IP Address
button, or press the shortcut keys Ctrl+Shift+P, enter AndroidLuaHelper: Input Device IP Address
, and then press Enter. Enter the IP address and port number in sequence.
Run
Set breakpoints at the required positions, click the Run
button, select Start Debugging
, and the debugger will enter the listening mode. Run the App on the phone to debug.
Acknowledgements
Warnings
- debugger requires the
App Lua Engine
to integrate the lua socket
plug-in.
Enjoy!