OpenHarmony开发者论坛

标题: 鸿蒙标准系统网络hdc适配介绍 [打印本页]

作者: 润开鸿_闻飞    时间: 2025-2-18 21:26
标题: 鸿蒙标准系统网络hdc适配介绍
[md]# 一、临时设置

## 1.1 导出开发板鸿蒙系统中的文件init.cfg

```shell
hdc file recv /etc/init.cfg init.cfg
```

## 1.2 修改init.cfg

**在init.cfg的post-fs-data下面加入**

```shell
"exec /bin/param set persist.hdc.mode tcp",
"exec /bin/param set persist.hdc.port 5555",
```

## 1.3 将init.cfg导回开发板中

```shell
hdc shell mount -o rw,remount /
hdc file send init.cfg /etc/init.cfg
pause
```

## 1.4 重启开发板

```shell
hdc shell reboot
```

## 1.5 网络连接hdc

### 1.5.1 查看并记录开发板IP地址

**查看开发板的IP并记录:192.168.3.100**

### 1.5.2 设置hdc为网络连接

```shell
hdc conn 192.168.3.101:5555
```

### 1.5.3 hdc连接开发板

```shell
hdc shell
```

# 二、源码中配置

**打开文件base/startup/init/services/etc/init.cfg,在init.cfg的post-fs-data下面加入**

```shell
"exec /bin/param set persist.hdc.mode tcp",
"exec /bin/param set persist.hdc.port 5555",
```

**重新编译源码烧录后按照上面1.5步骤操作**
[/md]




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5