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
Constraints
This permission can be applied for only on PCs/2-in-1 devices.
Only processes with the same UID can be debugged.
On a PC/2-in-1 device, after a binary or application requests the ohos.permission.kernel.DEBUGGER permission, it can be used as the debugging party to debug the following content with the same UID:
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
Constraints
This permission can be applied for only on PCs/2-in-1 devices.
On a PC/2-in-1 device, a binary or application that has requested the ohos.permission.kernel.ALLOW_DEBUG permission can be debugged by another binary or application that shares the same UID and possesses the ohos.permission.kernel.DEBUGGER permission.
In addition, when you use a real device for debugging in DevEco Studio, if the application on the PC/2-in-1 device uses the release signature and is configured with the ohos.permission.kernel.ALLOW_DEBUG permission, the application can also be attached for debugging.
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.