Prerequisites
- You have obtained the app ID.
- You have prepared a phone running Android 6.0 or later, and ensure that:
- You have installed Petal Lite Games of the latest version on the phone and signed in to Petal Lite Games using a HUAWEI ID that has completed identity verification.
- The phone has been successfully connected to a computer. For details, please refer to Connection of a Huawei Phone to a Computer.
Debugging Procedure
- Open QuickGameAssistant and sign in using the same HUAWEI ID used for Petal Lite Games.
The HUAWEI ID used for signing in to QuickGameAssistant must be the same as that used on the connected phone.

- On the wizard page, click Open Project, select a local Runtime project directory, and enter the quick game's app ID.
The project path cannot contain Chinese characters.

- If the project does not have a signature file, choose Tools > Generate Certificate on the menu bar to generate a certificate file. For details, please refer to Generating a Signing Certificate.

- Ensure that the phone is connected, and then click the run button.

- Run the quick game on the mirrored phone screen.

- If any issue is found, click the debug button. Debug and solve the issue in the debugger window. For details, please refer to Debugging Method.
- Step 1: Set breakpoints. You can set breakpoints at the line numbers of key code lines.
- Step 2: Perform debugging. Refresh the page and click the trace button to step through the code. The program will automatically pause at your breakpoints.
- Step 3: Check the code. At each breakpoint, you can inspect the execution state of the current line to pinpoint the exact location of the error.

- The tool supports undocking and docking the debugger window. For a better debugging experience, we recommend undocking the window. To re-dock the debugger window with the tool, click the debug button again.
- If the ADB port is occupied or the ADB version is incompatible with the tool's built-in ADB commands, please refer to How do I use the ADB provided by Huawei QuickGameAssistant?.
- If a quick game runs normally but shows a black screen during debugging, it is due to a version mismatch between Petal Light Games and this tool. To resolve this, uninstall Petal Light Games from your phone, and then click the debug button. Once the tool automatically installs the built-in version of Petal Light Game, the issue can be resolved.
- Click the stop icon to end the debugging.

Debugging Method
Debugging is the process of identifying and fixing errors within a script. It also allows us to step through code line by line to inspect the actual execution in real time.
[h2]Step 1: Setting Breakpoints
Breakpoints are markers where the browser debugging tool automatically pause execution; at a breakpoint, you can inspect current variable values, execute commands in the console, and perform other debugging operations. The steps are as follows:
- Select a page file, such as an HTML or JS file, on the left of the Sources pane, and click the line numbers in the middle source code area to set breakpoints. You can view all breakpoints in the Breakpoints column.

- You can write your own debugging code near the breakpoint.
[h2]Step 2: Performing Debugging
Reload the page and click the debugging button on the Sources pane to start tracing the code execution. The program will pause at each breakpoint. You can view the current call information in Call Stack.

The following table describes the debugging buttons.
Button | Button Name | Shortcut Key | Description |
 | Resume script execution | F8 | Automatically executes all code before the next breakpoint and pauses at the breakpoint. |
 | Step over next function call | F10 | Similar to Step, but skips built-in functions, such as alert. If you are not interested in the internal execution of built-in functions, you can click this button. |
 | Step into next function call | F11 | Similar to Step, but bypasses the asynchronous behavior of asynchronous functions. |
 | Step out of current function | Shift+F11 | Automatically executes the remaining code in the current function, exits the current function, and pauses at the next line of code that calls the current function. If you accidentally enter an irrelevant function, you can click this button to quickly execute the remaining lines and exit the current function. |
 | Step | F9 | Executes code line by line. |
 | Deactivate breakpoints | Ctrl+F8 | Enables or disables all breakpoints. This button does not affect program execution. |
 | - | - | Enables or disables automatic pausing of script execution when an error occurs. If the script is suspended due to an error, enable this function, reload the page, view variables in Sources, analyze the context, and locate the fault. |
[h2]Step 3: Checking the Code
At each breakpoint, you can inspect the code execution status in the Console pane or on the right of the Sources pane.
- Method 1: Monitor the code execution status on the right of the Sources pane.
- Watch: displays the current value of any expression. Click + in the upper right corner and enter an expression. The debugger displays the value of the expression and automatically recalculates the expression during execution.
- Breakpoints: displays the current breakpoint.
- Call Stack: displays the name of the currently called function. If no function name is available, anonymous will be displayed. If you click a stack item, the debugger jumps to the corresponding code and you can view all variables.
- Scope:
- Local: displays variables in the current function, with the variables and variable values highlighted in the source code.
- Global: displays global variables that are not in any function.

- Method 2: Press Esc. The Console pane is displayed in the lower part. You can query the variable value of the current statement. The execution result is displayed in the next line.

Applying for Permission Control
To strictly limit the HUAWEI IDs authorized for debugging, you can send an email as follows to Huawei personnel. Once configured, only designated HUAWEI IDs will be permitted to debug the quick game in QuickGameAssistant.
Email Subject | Restricting HUAWEI IDs for Quick Game Debugging in QuickGameAssistant |
Email Content | - Developer ID of the primary account in the team account
- Quick game app ID
- Quick game name
|
Email Address | minigame@huawei.com |
If the primary account in a team account has permission to debug a quick game, the primary account can grant the permission to other member accounts in the team.