harmony(鸿蒙)ShellCmdResult

2022-08-09 浏览 (841)

ShellCmdResult

The ShellCmdResult module provides the shell command execution result.

NOTE

The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.

Usage

The result is obtained by calling executeShellCommand in abilityDelegator.

import AbilityDelegatorRegistry from "@ohos.application.abilityDelegatorRegistry";
let abilityDelegator;
let cmd = "cmd";

abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.executeShellCommand(cmd, (err: any, data: any) => {
    console.info("executeShellCommand callback, failed: ", err);
    console.info("executeShellCommand callback, success: ", data);
});

ShellCmdResult

Describes the shell command execution result.

System capability: SystemCapability.Ability.AbilityRuntime.Core

NameTypeReadableWritableDescription
stdResultstringYesYesStandard output content.
exitCodenumberYesYesResult code.

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)APIs

harmony(鸿蒙)API Reference Document Description

harmony(鸿蒙)BundleStatusCallback

harmony(鸿蒙)innerBundleManager(deprecated)

harmony(鸿蒙)distributedBundle

harmony(鸿蒙)Bundle

harmony(鸿蒙)Context

harmony(鸿蒙)DataUriUtils

harmony(鸿蒙)EnterpriseAdminExtensionAbility

harmony(鸿蒙)Work Scheduler Callbacks

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/f7d0525b3077442e8c6d1120c49e8fc8