目录

FAQs About Packet Capture/Debugging Permission

ohos.permission.kernel.NET_RAW

Constraints

How to Use

Take the tcpdump tool as an example. When using the binary sign tool to sign the tool, configure the ohos.permission.kernel.NET_RAW permission in the module.json file.

{
    "requestPermissions": [
        {
            "name": "ohos.permission.kernel.NET_RAW"
        }
    ]
}

In the hishell terminal, use sudo to escalate privileges and execute tcpdump with the ohos.permission.kernel.NET_RAW permission. After the authentication is successful, you can perform the following operations:

# Example
sudo ./tcpdump

ohos.permission.kernel.DEBUGGER

Constraints

How to Use

Take the high-performance debugger LLDB as an example. When using the binary signing tool to sign the application, configure the ohos.permission.kernel.DEBUGGER permission in the module.json file.

{
    "requestPermissions": [
        {
            "name": "ohos.permission.kernel.DEBUGGER"
        }
    ]
}

On the HiShell endpoint, use the LLDB tool with the ohos.permission.kernel.DEBUGGER permission to attach to the debug_bin signed by the debug certificate in ATTACH mode for debugging.

# Example:
# Confirming that the UIDs are consistent
UID            PID  PPID C STIME TTY          TIME CMD
20020109     50262 32365 0 17:29:41 ?     00:00:00 lldb
20020109     52219 50262 0 17:31:15 ?     00:00:00 lldb-server
20020109     57631 13564 0 17:31:15 ?     00:00:00 debug_bin

# Attaching to the target process
(lldb) process attach --name debug_bin

ohos.permission.kernel.ALLOW_DEBUG

Constraints

How to Use

The following describes how to debug a PC application on a real device in DevEco Studio. You need to configure the ohos.permission.kernel.ALLOW_DEBUG permission in the **module.json5 **file of the application.

{
    "requestPermissions": [
        {
            "name": "ohos.permission.kernel.ALLOW_DEBUG"
        }
    ]
}

In the process list of the DevEco Studio debugger, you can view the process of the released application with the ohos.permission.kernel.ALLOW_DEBUG permission. Select the target process and attach it for debugging. For details, see Debugging Your App.