> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# setLynxInspectorConsoleDelegate

APISummary
注册 `LynxView` 实例的 console 监听器，用于监听该实例的所有 console 消息。

## 语法

### iOS

```objective-c title="LynxBaseInspectorOwner.h"
- (void)setLynxInspectorConsoleDelegate:(id _Nonnull)delegate;
```

### Android

```java title="LynxBaseInspectorOwner.java"
void setLynxInspectorConsoleDelegate(Object delegate);
```

### Harmony

```ts title="LynxBaseInspectorOwner.ets"
setLynxInspectorConsoleDelegate(delegate: LynxInspectorConsoleDelegate): void;
```

### 参数说明

- `delegate`: 实现了 [`LynxInspectorConsoleDelegate`](/next/zh/api/lynx-devtool-native-api/lynx-inspector-console-delegate.md#语法) 的对象。

## 使用示例

请参考 [`LynxInspectorConsoleDelegate`](/next/zh/api/lynx-devtool-native-api/lynx-inspector-console-delegate.md#使用示例)。

## 兼容性


**Compatibility Table**
**Query:** `lynx-devtool-native-api.lynx-base-inspector-owner.set-lynx-inspector-console-delegate`

**Platform Support**

| Platform | Version Added | Notes |
|----------|---------------|-------|
| Android | 3.0 | - |
| iOS | 3.0 | - |
| HarmonyOS | 3.5 | - |
| Web | ❌ No | - |

**Description:** setLynxInspectorConsoleDelegate

