> For the complete documentation index, see [llms.txt](https://160668873.gitbook.io/tkey-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://160668873.gitbook.io/tkey-docs/xian-shang-wen-ti-zhen-duan/remote-debug.md).

# 夜间开放端口，挑选流量远程 Debug

## 配置 IntelliJ IDEA 远程 Debug

![debug 配置](http://img.gitnavi.com/tkey/remote-debug-1.png)

* **复制这个 VM 配置**

```
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
```

## 调整应用启动参数

* 在 应用的原有 JAVA\_OPTS 参数基础上补加，效果如下：

```
JAVA_OPTS="-Xms512m -Xmx2048m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
```

## 启动本地项目

![debug 启动](http://img.gitnavi.com/tkey/remote-debug-2.png)

* 然后在项目代码中打断点，跟平时本地 debug 一样

![debug 住断点效果](http://img.gitnavi.com/tkey/remote-debug-3.png)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://160668873.gitbook.io/tkey-docs/xian-shang-wen-ti-zhen-duan/remote-debug.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
