1e41f4b71Sopenharmony_ci# @ohos.app.ability.ChildProcess 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci开发者自定义子进程的基类。通过[childProcessManager](js-apis-app-ability-childProcessManager.md)启动子进程时,需要继承此类并重写入口方法。 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **说明:** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> 本模块首批接口从API version 11开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 8e41f4b71Sopenharmony_ci> 9e41f4b71Sopenharmony_ci> 本模块接口仅可在Stage模型下使用。 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci## 导入模块 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci```ts 14e41f4b71Sopenharmony_ciimport { ChildProcess } from '@kit.AbilityKit'; 15e41f4b71Sopenharmony_ci``` 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci## ChildProcess.onStart 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_cionStart(args?: ChildProcessArgs): void 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci子进程的入口方法,通过[childProcessManager](js-apis-app-ability-childProcessManager.md)启动子进程后调用。 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Ability.AbilityRuntime.Core 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci**参数:** 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci | 参数名 | 类型 | 必填 | 说明 | 28e41f4b71Sopenharmony_ci | -------- | -------- | -------- | -------- | 29e41f4b71Sopenharmony_ci | args<sup>12+</sup> | [ChildProcessArgs](js-apis-app-ability-childProcessArgs.md) | 否 | 传递到子进程的参数。 | 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci**示例:** 32e41f4b71Sopenharmony_ci```ts 33e41f4b71Sopenharmony_ciimport { ChildProcess, ChildProcessArgs } from '@kit.AbilityKit'; 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ciexport default class DemoProcess extends ChildProcess { 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci onStart(args?: ChildProcessArgs) { 38e41f4b71Sopenharmony_ci let entryParams = args?.entryParams; 39e41f4b71Sopenharmony_ci let fd = args?.fds?.key1; 40e41f4b71Sopenharmony_ci // .. 41e41f4b71Sopenharmony_ci } 42e41f4b71Sopenharmony_ci} 43e41f4b71Sopenharmony_ci```