@oniroproject/core 0.15.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +29 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +28 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -947,6 +947,8 @@ declare function listDevices(config: ConfigProvider, opts?: {
|
|
|
947
947
|
timeoutMs?: number;
|
|
948
948
|
logger?: Logger;
|
|
949
949
|
}): Promise<DeviceInfo[]>;
|
|
950
|
+
/** Whether a listed target can be addressed: connected, or of a status hdc did not report. */
|
|
951
|
+
declare function isUsableDevice(device: DeviceInfo): boolean;
|
|
950
952
|
/**
|
|
951
953
|
* Resolve which device serial to address: an explicit `serial` wins, then the
|
|
952
954
|
* `ONIRO_DEVICE_SERIAL` / `DEVICE_SERIAL` env vars, then the single connected
|
|
@@ -2544,7 +2546,7 @@ declare const SIGNING_ERRORS: {
|
|
|
2544
2546
|
readonly DEVICE_ADD: "AppGallery Connect did not register the device.";
|
|
2545
2547
|
readonly DEVICE_LIMIT: "This team has reached its device limit. Remove an unused device in AppGallery Connect and retry.";
|
|
2546
2548
|
readonly DEVICE_NAME_REPEAT: "A device with that name is already registered. Retry.";
|
|
2547
|
-
readonly DEVICE_NONE: "
|
|
2549
|
+
readonly DEVICE_NONE: "This team has no registered device and none could be registered from here, but a debug profile must name at least one. Connect a device that reports a UDID (`hdc shell bm get -u`), or register one in AppGallery Connect, and retry.";
|
|
2548
2550
|
readonly PROFILE_ADD: "AppGallery Connect did not issue the provisioning profile.";
|
|
2549
2551
|
readonly PROFILE_NAME_REPEAT: "A provisioning profile with that name already exists in AppGallery Connect. Retry.";
|
|
2550
2552
|
readonly PROVISION_LIMIT: "This team has reached its debug-profile limit. Delete unused profiles in AppGallery Connect and retry.";
|
|
@@ -2610,4 +2612,4 @@ declare function harmonyOsAutoSign(opts: HarmonyOsAutoSignOptions): Promise<Harm
|
|
|
2610
2612
|
|
|
2611
2613
|
declare const VERSION: string;
|
|
2612
2614
|
|
|
2613
|
-
export { ALL_SDKS, APL_VALUES, APP_FEATURE_VALUES, type AbilityInfo, type AgcAuthInfo, AgcError, type Apl, type AppFeature, type ApplyChangesOptions, type ApplyChangesResult, type BuildHapOptions, type BuildHapResult, type BundleOptions, CancelledError, type CaptureBurstOptions, type CaptureLogOptions, type CaptureLogResult, ChecksumMismatchError, type CmdToolsFlavour, CmdToolsNotInstalledError, type CmdToolsStatus, type CmdWrapper, type CodelinterFinding, type CodelinterReport, type CodelinterResult, type CodelinterSummary, CommandFailedError, type ConfigKey, type ConfigProvider, type CreateScaffoldOptions, type CreateScaffoldResult, type DeveloperAgreementStatus, type DeviceFullInfo, type DeviceInfo, type DiscoverHapsOptions, type DisplaySize, type DisplaySizeOptions, type DownloadOptions, type DumpLayoutOptions, type DumpLayoutResult, type DumpLogOptions, type EmulatorStatus, type ExtractZipOptions, type FlatLayoutNode, type GenerateSigningConfigsOptions, type GestureUitestOptions, type GetDeviceInfoOptions, HARMONYOS_SDK_VERSIONS, HUAWEI_SITES, type HapAssetDiff, type HarmonyOsAutoSignOptions, type HarmonyOsSdk, type HarmonyOsSession, type HarmonyOsSessionOptions, type HarmonyOsSigningResult, type HdcExecOptions, type HdcExecResult, type HdcShellOptions, type HidumperOptions, type HilogEntry, type HilogLevel, type HuaweiSite, type HuaweiSiteCode, type HuaweiTeam, type HuaweiUserInfo, INSTALL_TMP_DIRNAME, type InputType, type InstallAppOptions, type InstallAppResult, type InstallCandidate, type InstallCmdToolsOptions, type InstallEmulatorOptions, type InstallMethod, type InstallSdkFromArchiveOptions, type InstallSdkOptions, type InstallTempDir, type InstallTempDirOptions, type InstalledSdk, InsufficientSpaceError, type KeyboardState, type LaunchAppOptions, type LayoutNode, type LayoutSelector, type LocateTargetOptions, type LocatedTarget, type Logger, type ModuleHaps, OHOS_DAILY_BUILDS_URL, OHOS_URL_BASE, type OniroContext, OniroError, type OsFolder, type OutputSink, type ParamOptions, type PerformInputOptions, type PerformInputResult, type PickTargetFailure, type PickedHap, type PrepareSigningOptions, type PrepareSigningResult, type ProgressReporter, type ProgressUpdate, type ProjectModule, type Prompter, type ProvisionProfileInfo, type RawLayoutNode, type RawTouchEvent, type RebootDecision, type RebootOptions, type RecvFileOptions, type RunCodelinterOptions, type RunHvigorwOptions, type RunHvigorwResult, type RunOhpmOptions, type RunProcessOptions, type RunningProcess, type RuntimeOs, SIGNING_ERRORS, type ScreenDump, type Screenshot, type ScreenshotOptions, type SdkArchiveInfo, type SdkInfo, SdkNotInstalledError, type SdkRelease, type SendFileOptions, type SendGestureOptions, type SendInputOptions, type SendRawTouchOptions, type SetHilogLevelOptions, type SigningKind, type SigningMaterialPaths, type SigningPasswords, type StartEmulatorOptions, type StoredSession, type StreamHilogOptions, TMP_DIR_HINT, TargetNotFoundError, type TemplateOption, type TokenStore, type UiInputType, UnsupportedPlatformError, VERSION, type WaitForBootOptions, type WaitForBundleOptions, type WaitForConditionOptions, type WaitForLogOptions, type WaitForTargetOptions, type WatchLogOptions, type Waypoint, appSandboxDir, applyChanges, assertDevicePath, assertLayoutSelector, attemptHdcConnection, buildCmdWrapper, buildGestureCommands, buildGestureUitestCommand, buildHap, buildHvigorwArgs, buildInputCommand, buildRawTouchCommand, bundleNameFromHapConfig, captureBurst, captureLog, cleanCodelinterOutput, consoleLogger, createHarmonyOsSession, createInstallTempDir, createMaterial, createScaffold, createTempWorkDir, createTokenStore, decideInstallMethod, decideReboot, decryptPwd, dedupEntries, defaultContext, defaultPaths, describeLayoutNode, detectAaStartFailure, detectCmdToolsFlavour, detectInstallFailure, detectProjectSdkVersion, detectRuntimeOs, detectSigningConfigNames, diagnoseBuildFailure, diffEntryNames, diffHapAssets, discoverHaps, downloadAndInstallSdk, downloadFile, dumpLayout, dumpLog, dumpRenderService, dumpScreen, dumpWindow, encryptPwd, ensureFreeSpace, ensureInstallOk, ensureOhModules, ensureOk, ensureRemoteOk, escapeCmdArgument, escapeCmdCommand, existingHapOrUnsigned, extractTarball, extractZipWithProgress, findAppProcessId, findCmdToolsSourceDir, findCoveredNodes, findHarmonyOsSdk, findKeyboardWindow, findLayoutNodes, findMissingProjectSdk, findRunningProcess, findSdkOsDir, flattenLayout, forceStop, formatBytes, generateSigningConfigs, getBundleName, getCmdToolsBin, getCmdToolsDownloadUrl, getCmdToolsPath, getCmdToolsStatus, getDeviceInfo, getDisplaySize, getEmulatorDir, getEmulatorStatus, getFreeSpaceBytes, getHdcPath, getHvigorwPath, getImeBundles, getInstalledSdks, getKey, getMainAbility, getOhosBaseSdkHome, getOhpmPath, getOsFolder, getSdkFilename, getSdkRootDir, getSupportedSdksForUi, harmonyOsAutoSign, harmonyOsSdkLabelForApi, hdcClientFailure, hdcExec, hdcTargetArgs, hdcTargetArgsFor, hideKeyboard, hilogTimeMs, installApp, installCmdTools, installEmulator, installFailureReason, installSdkFromArchive, isBundleInstalled, isCmdToolsInstalled, isEmulatorInstalled, isOutOfSpaceError, isRamBackedPath, isUnsignedHap, isValidBundleName, isValidProjectName, killProcessTree, launchApp, listAbilities, listDevices, listModules, listRunningProcesses, listTemplates, locateTarget, missingProjectRootFiles, needsCmdWrapper, nonInteractivePrompter, noopLogger, noopProgress, normaliseLocalPath, paramGet, paramGetMany, paramSet, parseBounds, parseCodelinterFindings, parseCodelinterReport, parseDeviceList, parseHilogLine, parseImeBundles, parseMainAbilityFromBmDump, parseParamValues, parseRemoteExit, performInput, pickHap, pickSigningKind, pickTarget, prepareSigning, pruneLayout, readHapBundleName, readJson5File, readJsonFile, readProvisionProfile, readZipEntry, reboot, recvFile, removeCmdTools, removeEmulator, removeSdk, removeTempWorkDir, requireHarmonyOsSdk, resolveDeviceSerial, resolveKeyEvent, resolveTmpRoot, runCodelinter, runHvigorw, runOhpm, runProcess, scopedLogger, selectDevice, sendFile, sendGesture, sendInput, sendRawTouch, setHilogLevel, shell, shellChecked, spawnCompat, startEmulator, staticConfig, stopEmulator, streamHilog, takeScreenshot, toLongPath, toSpaceError, uninstallApp, unsignedHapRejection, validateTemplateLayout, verifySha256, waitForBoot, waitForBundle, waitForCondition, waitForLog, waitForTarget, watchLog, waypointsToRawEvents, withoutWindow, writeJson5File, writeJsonFile };
|
|
2615
|
+
export { ALL_SDKS, APL_VALUES, APP_FEATURE_VALUES, type AbilityInfo, type AgcAuthInfo, AgcError, type Apl, type AppFeature, type ApplyChangesOptions, type ApplyChangesResult, type BuildHapOptions, type BuildHapResult, type BundleOptions, CancelledError, type CaptureBurstOptions, type CaptureLogOptions, type CaptureLogResult, ChecksumMismatchError, type CmdToolsFlavour, CmdToolsNotInstalledError, type CmdToolsStatus, type CmdWrapper, type CodelinterFinding, type CodelinterReport, type CodelinterResult, type CodelinterSummary, CommandFailedError, type ConfigKey, type ConfigProvider, type CreateScaffoldOptions, type CreateScaffoldResult, type DeveloperAgreementStatus, type DeviceFullInfo, type DeviceInfo, type DiscoverHapsOptions, type DisplaySize, type DisplaySizeOptions, type DownloadOptions, type DumpLayoutOptions, type DumpLayoutResult, type DumpLogOptions, type EmulatorStatus, type ExtractZipOptions, type FlatLayoutNode, type GenerateSigningConfigsOptions, type GestureUitestOptions, type GetDeviceInfoOptions, HARMONYOS_SDK_VERSIONS, HUAWEI_SITES, type HapAssetDiff, type HarmonyOsAutoSignOptions, type HarmonyOsSdk, type HarmonyOsSession, type HarmonyOsSessionOptions, type HarmonyOsSigningResult, type HdcExecOptions, type HdcExecResult, type HdcShellOptions, type HidumperOptions, type HilogEntry, type HilogLevel, type HuaweiSite, type HuaweiSiteCode, type HuaweiTeam, type HuaweiUserInfo, INSTALL_TMP_DIRNAME, type InputType, type InstallAppOptions, type InstallAppResult, type InstallCandidate, type InstallCmdToolsOptions, type InstallEmulatorOptions, type InstallMethod, type InstallSdkFromArchiveOptions, type InstallSdkOptions, type InstallTempDir, type InstallTempDirOptions, type InstalledSdk, InsufficientSpaceError, type KeyboardState, type LaunchAppOptions, type LayoutNode, type LayoutSelector, type LocateTargetOptions, type LocatedTarget, type Logger, type ModuleHaps, OHOS_DAILY_BUILDS_URL, OHOS_URL_BASE, type OniroContext, OniroError, type OsFolder, type OutputSink, type ParamOptions, type PerformInputOptions, type PerformInputResult, type PickTargetFailure, type PickedHap, type PrepareSigningOptions, type PrepareSigningResult, type ProgressReporter, type ProgressUpdate, type ProjectModule, type Prompter, type ProvisionProfileInfo, type RawLayoutNode, type RawTouchEvent, type RebootDecision, type RebootOptions, type RecvFileOptions, type RunCodelinterOptions, type RunHvigorwOptions, type RunHvigorwResult, type RunOhpmOptions, type RunProcessOptions, type RunningProcess, type RuntimeOs, SIGNING_ERRORS, type ScreenDump, type Screenshot, type ScreenshotOptions, type SdkArchiveInfo, type SdkInfo, SdkNotInstalledError, type SdkRelease, type SendFileOptions, type SendGestureOptions, type SendInputOptions, type SendRawTouchOptions, type SetHilogLevelOptions, type SigningKind, type SigningMaterialPaths, type SigningPasswords, type StartEmulatorOptions, type StoredSession, type StreamHilogOptions, TMP_DIR_HINT, TargetNotFoundError, type TemplateOption, type TokenStore, type UiInputType, UnsupportedPlatformError, VERSION, type WaitForBootOptions, type WaitForBundleOptions, type WaitForConditionOptions, type WaitForLogOptions, type WaitForTargetOptions, type WatchLogOptions, type Waypoint, appSandboxDir, applyChanges, assertDevicePath, assertLayoutSelector, attemptHdcConnection, buildCmdWrapper, buildGestureCommands, buildGestureUitestCommand, buildHap, buildHvigorwArgs, buildInputCommand, buildRawTouchCommand, bundleNameFromHapConfig, captureBurst, captureLog, cleanCodelinterOutput, consoleLogger, createHarmonyOsSession, createInstallTempDir, createMaterial, createScaffold, createTempWorkDir, createTokenStore, decideInstallMethod, decideReboot, decryptPwd, dedupEntries, defaultContext, defaultPaths, describeLayoutNode, detectAaStartFailure, detectCmdToolsFlavour, detectInstallFailure, detectProjectSdkVersion, detectRuntimeOs, detectSigningConfigNames, diagnoseBuildFailure, diffEntryNames, diffHapAssets, discoverHaps, downloadAndInstallSdk, downloadFile, dumpLayout, dumpLog, dumpRenderService, dumpScreen, dumpWindow, encryptPwd, ensureFreeSpace, ensureInstallOk, ensureOhModules, ensureOk, ensureRemoteOk, escapeCmdArgument, escapeCmdCommand, existingHapOrUnsigned, extractTarball, extractZipWithProgress, findAppProcessId, findCmdToolsSourceDir, findCoveredNodes, findHarmonyOsSdk, findKeyboardWindow, findLayoutNodes, findMissingProjectSdk, findRunningProcess, findSdkOsDir, flattenLayout, forceStop, formatBytes, generateSigningConfigs, getBundleName, getCmdToolsBin, getCmdToolsDownloadUrl, getCmdToolsPath, getCmdToolsStatus, getDeviceInfo, getDisplaySize, getEmulatorDir, getEmulatorStatus, getFreeSpaceBytes, getHdcPath, getHvigorwPath, getImeBundles, getInstalledSdks, getKey, getMainAbility, getOhosBaseSdkHome, getOhpmPath, getOsFolder, getSdkFilename, getSdkRootDir, getSupportedSdksForUi, harmonyOsAutoSign, harmonyOsSdkLabelForApi, hdcClientFailure, hdcExec, hdcTargetArgs, hdcTargetArgsFor, hideKeyboard, hilogTimeMs, installApp, installCmdTools, installEmulator, installFailureReason, installSdkFromArchive, isBundleInstalled, isCmdToolsInstalled, isEmulatorInstalled, isOutOfSpaceError, isRamBackedPath, isUnsignedHap, isUsableDevice, isValidBundleName, isValidProjectName, killProcessTree, launchApp, listAbilities, listDevices, listModules, listRunningProcesses, listTemplates, locateTarget, missingProjectRootFiles, needsCmdWrapper, nonInteractivePrompter, noopLogger, noopProgress, normaliseLocalPath, paramGet, paramGetMany, paramSet, parseBounds, parseCodelinterFindings, parseCodelinterReport, parseDeviceList, parseHilogLine, parseImeBundles, parseMainAbilityFromBmDump, parseParamValues, parseRemoteExit, performInput, pickHap, pickSigningKind, pickTarget, prepareSigning, pruneLayout, readHapBundleName, readJson5File, readJsonFile, readProvisionProfile, readZipEntry, reboot, recvFile, removeCmdTools, removeEmulator, removeSdk, removeTempWorkDir, requireHarmonyOsSdk, resolveDeviceSerial, resolveKeyEvent, resolveTmpRoot, runCodelinter, runHvigorw, runOhpm, runProcess, scopedLogger, selectDevice, sendFile, sendGesture, sendInput, sendRawTouch, setHilogLevel, shell, shellChecked, spawnCompat, startEmulator, staticConfig, stopEmulator, streamHilog, takeScreenshot, toLongPath, toSpaceError, uninstallApp, unsignedHapRejection, validateTemplateLayout, verifySha256, waitForBoot, waitForBundle, waitForCondition, waitForLog, waitForTarget, watchLog, waypointsToRawEvents, withoutWindow, writeJson5File, writeJsonFile };
|
package/dist/index.d.ts
CHANGED
|
@@ -947,6 +947,8 @@ declare function listDevices(config: ConfigProvider, opts?: {
|
|
|
947
947
|
timeoutMs?: number;
|
|
948
948
|
logger?: Logger;
|
|
949
949
|
}): Promise<DeviceInfo[]>;
|
|
950
|
+
/** Whether a listed target can be addressed: connected, or of a status hdc did not report. */
|
|
951
|
+
declare function isUsableDevice(device: DeviceInfo): boolean;
|
|
950
952
|
/**
|
|
951
953
|
* Resolve which device serial to address: an explicit `serial` wins, then the
|
|
952
954
|
* `ONIRO_DEVICE_SERIAL` / `DEVICE_SERIAL` env vars, then the single connected
|
|
@@ -2544,7 +2546,7 @@ declare const SIGNING_ERRORS: {
|
|
|
2544
2546
|
readonly DEVICE_ADD: "AppGallery Connect did not register the device.";
|
|
2545
2547
|
readonly DEVICE_LIMIT: "This team has reached its device limit. Remove an unused device in AppGallery Connect and retry.";
|
|
2546
2548
|
readonly DEVICE_NAME_REPEAT: "A device with that name is already registered. Retry.";
|
|
2547
|
-
readonly DEVICE_NONE: "
|
|
2549
|
+
readonly DEVICE_NONE: "This team has no registered device and none could be registered from here, but a debug profile must name at least one. Connect a device that reports a UDID (`hdc shell bm get -u`), or register one in AppGallery Connect, and retry.";
|
|
2548
2550
|
readonly PROFILE_ADD: "AppGallery Connect did not issue the provisioning profile.";
|
|
2549
2551
|
readonly PROFILE_NAME_REPEAT: "A provisioning profile with that name already exists in AppGallery Connect. Retry.";
|
|
2550
2552
|
readonly PROVISION_LIMIT: "This team has reached its debug-profile limit. Delete unused profiles in AppGallery Connect and retry.";
|
|
@@ -2610,4 +2612,4 @@ declare function harmonyOsAutoSign(opts: HarmonyOsAutoSignOptions): Promise<Harm
|
|
|
2610
2612
|
|
|
2611
2613
|
declare const VERSION: string;
|
|
2612
2614
|
|
|
2613
|
-
export { ALL_SDKS, APL_VALUES, APP_FEATURE_VALUES, type AbilityInfo, type AgcAuthInfo, AgcError, type Apl, type AppFeature, type ApplyChangesOptions, type ApplyChangesResult, type BuildHapOptions, type BuildHapResult, type BundleOptions, CancelledError, type CaptureBurstOptions, type CaptureLogOptions, type CaptureLogResult, ChecksumMismatchError, type CmdToolsFlavour, CmdToolsNotInstalledError, type CmdToolsStatus, type CmdWrapper, type CodelinterFinding, type CodelinterReport, type CodelinterResult, type CodelinterSummary, CommandFailedError, type ConfigKey, type ConfigProvider, type CreateScaffoldOptions, type CreateScaffoldResult, type DeveloperAgreementStatus, type DeviceFullInfo, type DeviceInfo, type DiscoverHapsOptions, type DisplaySize, type DisplaySizeOptions, type DownloadOptions, type DumpLayoutOptions, type DumpLayoutResult, type DumpLogOptions, type EmulatorStatus, type ExtractZipOptions, type FlatLayoutNode, type GenerateSigningConfigsOptions, type GestureUitestOptions, type GetDeviceInfoOptions, HARMONYOS_SDK_VERSIONS, HUAWEI_SITES, type HapAssetDiff, type HarmonyOsAutoSignOptions, type HarmonyOsSdk, type HarmonyOsSession, type HarmonyOsSessionOptions, type HarmonyOsSigningResult, type HdcExecOptions, type HdcExecResult, type HdcShellOptions, type HidumperOptions, type HilogEntry, type HilogLevel, type HuaweiSite, type HuaweiSiteCode, type HuaweiTeam, type HuaweiUserInfo, INSTALL_TMP_DIRNAME, type InputType, type InstallAppOptions, type InstallAppResult, type InstallCandidate, type InstallCmdToolsOptions, type InstallEmulatorOptions, type InstallMethod, type InstallSdkFromArchiveOptions, type InstallSdkOptions, type InstallTempDir, type InstallTempDirOptions, type InstalledSdk, InsufficientSpaceError, type KeyboardState, type LaunchAppOptions, type LayoutNode, type LayoutSelector, type LocateTargetOptions, type LocatedTarget, type Logger, type ModuleHaps, OHOS_DAILY_BUILDS_URL, OHOS_URL_BASE, type OniroContext, OniroError, type OsFolder, type OutputSink, type ParamOptions, type PerformInputOptions, type PerformInputResult, type PickTargetFailure, type PickedHap, type PrepareSigningOptions, type PrepareSigningResult, type ProgressReporter, type ProgressUpdate, type ProjectModule, type Prompter, type ProvisionProfileInfo, type RawLayoutNode, type RawTouchEvent, type RebootDecision, type RebootOptions, type RecvFileOptions, type RunCodelinterOptions, type RunHvigorwOptions, type RunHvigorwResult, type RunOhpmOptions, type RunProcessOptions, type RunningProcess, type RuntimeOs, SIGNING_ERRORS, type ScreenDump, type Screenshot, type ScreenshotOptions, type SdkArchiveInfo, type SdkInfo, SdkNotInstalledError, type SdkRelease, type SendFileOptions, type SendGestureOptions, type SendInputOptions, type SendRawTouchOptions, type SetHilogLevelOptions, type SigningKind, type SigningMaterialPaths, type SigningPasswords, type StartEmulatorOptions, type StoredSession, type StreamHilogOptions, TMP_DIR_HINT, TargetNotFoundError, type TemplateOption, type TokenStore, type UiInputType, UnsupportedPlatformError, VERSION, type WaitForBootOptions, type WaitForBundleOptions, type WaitForConditionOptions, type WaitForLogOptions, type WaitForTargetOptions, type WatchLogOptions, type Waypoint, appSandboxDir, applyChanges, assertDevicePath, assertLayoutSelector, attemptHdcConnection, buildCmdWrapper, buildGestureCommands, buildGestureUitestCommand, buildHap, buildHvigorwArgs, buildInputCommand, buildRawTouchCommand, bundleNameFromHapConfig, captureBurst, captureLog, cleanCodelinterOutput, consoleLogger, createHarmonyOsSession, createInstallTempDir, createMaterial, createScaffold, createTempWorkDir, createTokenStore, decideInstallMethod, decideReboot, decryptPwd, dedupEntries, defaultContext, defaultPaths, describeLayoutNode, detectAaStartFailure, detectCmdToolsFlavour, detectInstallFailure, detectProjectSdkVersion, detectRuntimeOs, detectSigningConfigNames, diagnoseBuildFailure, diffEntryNames, diffHapAssets, discoverHaps, downloadAndInstallSdk, downloadFile, dumpLayout, dumpLog, dumpRenderService, dumpScreen, dumpWindow, encryptPwd, ensureFreeSpace, ensureInstallOk, ensureOhModules, ensureOk, ensureRemoteOk, escapeCmdArgument, escapeCmdCommand, existingHapOrUnsigned, extractTarball, extractZipWithProgress, findAppProcessId, findCmdToolsSourceDir, findCoveredNodes, findHarmonyOsSdk, findKeyboardWindow, findLayoutNodes, findMissingProjectSdk, findRunningProcess, findSdkOsDir, flattenLayout, forceStop, formatBytes, generateSigningConfigs, getBundleName, getCmdToolsBin, getCmdToolsDownloadUrl, getCmdToolsPath, getCmdToolsStatus, getDeviceInfo, getDisplaySize, getEmulatorDir, getEmulatorStatus, getFreeSpaceBytes, getHdcPath, getHvigorwPath, getImeBundles, getInstalledSdks, getKey, getMainAbility, getOhosBaseSdkHome, getOhpmPath, getOsFolder, getSdkFilename, getSdkRootDir, getSupportedSdksForUi, harmonyOsAutoSign, harmonyOsSdkLabelForApi, hdcClientFailure, hdcExec, hdcTargetArgs, hdcTargetArgsFor, hideKeyboard, hilogTimeMs, installApp, installCmdTools, installEmulator, installFailureReason, installSdkFromArchive, isBundleInstalled, isCmdToolsInstalled, isEmulatorInstalled, isOutOfSpaceError, isRamBackedPath, isUnsignedHap, isValidBundleName, isValidProjectName, killProcessTree, launchApp, listAbilities, listDevices, listModules, listRunningProcesses, listTemplates, locateTarget, missingProjectRootFiles, needsCmdWrapper, nonInteractivePrompter, noopLogger, noopProgress, normaliseLocalPath, paramGet, paramGetMany, paramSet, parseBounds, parseCodelinterFindings, parseCodelinterReport, parseDeviceList, parseHilogLine, parseImeBundles, parseMainAbilityFromBmDump, parseParamValues, parseRemoteExit, performInput, pickHap, pickSigningKind, pickTarget, prepareSigning, pruneLayout, readHapBundleName, readJson5File, readJsonFile, readProvisionProfile, readZipEntry, reboot, recvFile, removeCmdTools, removeEmulator, removeSdk, removeTempWorkDir, requireHarmonyOsSdk, resolveDeviceSerial, resolveKeyEvent, resolveTmpRoot, runCodelinter, runHvigorw, runOhpm, runProcess, scopedLogger, selectDevice, sendFile, sendGesture, sendInput, sendRawTouch, setHilogLevel, shell, shellChecked, spawnCompat, startEmulator, staticConfig, stopEmulator, streamHilog, takeScreenshot, toLongPath, toSpaceError, uninstallApp, unsignedHapRejection, validateTemplateLayout, verifySha256, waitForBoot, waitForBundle, waitForCondition, waitForLog, waitForTarget, watchLog, waypointsToRawEvents, withoutWindow, writeJson5File, writeJsonFile };
|
|
2615
|
+
export { ALL_SDKS, APL_VALUES, APP_FEATURE_VALUES, type AbilityInfo, type AgcAuthInfo, AgcError, type Apl, type AppFeature, type ApplyChangesOptions, type ApplyChangesResult, type BuildHapOptions, type BuildHapResult, type BundleOptions, CancelledError, type CaptureBurstOptions, type CaptureLogOptions, type CaptureLogResult, ChecksumMismatchError, type CmdToolsFlavour, CmdToolsNotInstalledError, type CmdToolsStatus, type CmdWrapper, type CodelinterFinding, type CodelinterReport, type CodelinterResult, type CodelinterSummary, CommandFailedError, type ConfigKey, type ConfigProvider, type CreateScaffoldOptions, type CreateScaffoldResult, type DeveloperAgreementStatus, type DeviceFullInfo, type DeviceInfo, type DiscoverHapsOptions, type DisplaySize, type DisplaySizeOptions, type DownloadOptions, type DumpLayoutOptions, type DumpLayoutResult, type DumpLogOptions, type EmulatorStatus, type ExtractZipOptions, type FlatLayoutNode, type GenerateSigningConfigsOptions, type GestureUitestOptions, type GetDeviceInfoOptions, HARMONYOS_SDK_VERSIONS, HUAWEI_SITES, type HapAssetDiff, type HarmonyOsAutoSignOptions, type HarmonyOsSdk, type HarmonyOsSession, type HarmonyOsSessionOptions, type HarmonyOsSigningResult, type HdcExecOptions, type HdcExecResult, type HdcShellOptions, type HidumperOptions, type HilogEntry, type HilogLevel, type HuaweiSite, type HuaweiSiteCode, type HuaweiTeam, type HuaweiUserInfo, INSTALL_TMP_DIRNAME, type InputType, type InstallAppOptions, type InstallAppResult, type InstallCandidate, type InstallCmdToolsOptions, type InstallEmulatorOptions, type InstallMethod, type InstallSdkFromArchiveOptions, type InstallSdkOptions, type InstallTempDir, type InstallTempDirOptions, type InstalledSdk, InsufficientSpaceError, type KeyboardState, type LaunchAppOptions, type LayoutNode, type LayoutSelector, type LocateTargetOptions, type LocatedTarget, type Logger, type ModuleHaps, OHOS_DAILY_BUILDS_URL, OHOS_URL_BASE, type OniroContext, OniroError, type OsFolder, type OutputSink, type ParamOptions, type PerformInputOptions, type PerformInputResult, type PickTargetFailure, type PickedHap, type PrepareSigningOptions, type PrepareSigningResult, type ProgressReporter, type ProgressUpdate, type ProjectModule, type Prompter, type ProvisionProfileInfo, type RawLayoutNode, type RawTouchEvent, type RebootDecision, type RebootOptions, type RecvFileOptions, type RunCodelinterOptions, type RunHvigorwOptions, type RunHvigorwResult, type RunOhpmOptions, type RunProcessOptions, type RunningProcess, type RuntimeOs, SIGNING_ERRORS, type ScreenDump, type Screenshot, type ScreenshotOptions, type SdkArchiveInfo, type SdkInfo, SdkNotInstalledError, type SdkRelease, type SendFileOptions, type SendGestureOptions, type SendInputOptions, type SendRawTouchOptions, type SetHilogLevelOptions, type SigningKind, type SigningMaterialPaths, type SigningPasswords, type StartEmulatorOptions, type StoredSession, type StreamHilogOptions, TMP_DIR_HINT, TargetNotFoundError, type TemplateOption, type TokenStore, type UiInputType, UnsupportedPlatformError, VERSION, type WaitForBootOptions, type WaitForBundleOptions, type WaitForConditionOptions, type WaitForLogOptions, type WaitForTargetOptions, type WatchLogOptions, type Waypoint, appSandboxDir, applyChanges, assertDevicePath, assertLayoutSelector, attemptHdcConnection, buildCmdWrapper, buildGestureCommands, buildGestureUitestCommand, buildHap, buildHvigorwArgs, buildInputCommand, buildRawTouchCommand, bundleNameFromHapConfig, captureBurst, captureLog, cleanCodelinterOutput, consoleLogger, createHarmonyOsSession, createInstallTempDir, createMaterial, createScaffold, createTempWorkDir, createTokenStore, decideInstallMethod, decideReboot, decryptPwd, dedupEntries, defaultContext, defaultPaths, describeLayoutNode, detectAaStartFailure, detectCmdToolsFlavour, detectInstallFailure, detectProjectSdkVersion, detectRuntimeOs, detectSigningConfigNames, diagnoseBuildFailure, diffEntryNames, diffHapAssets, discoverHaps, downloadAndInstallSdk, downloadFile, dumpLayout, dumpLog, dumpRenderService, dumpScreen, dumpWindow, encryptPwd, ensureFreeSpace, ensureInstallOk, ensureOhModules, ensureOk, ensureRemoteOk, escapeCmdArgument, escapeCmdCommand, existingHapOrUnsigned, extractTarball, extractZipWithProgress, findAppProcessId, findCmdToolsSourceDir, findCoveredNodes, findHarmonyOsSdk, findKeyboardWindow, findLayoutNodes, findMissingProjectSdk, findRunningProcess, findSdkOsDir, flattenLayout, forceStop, formatBytes, generateSigningConfigs, getBundleName, getCmdToolsBin, getCmdToolsDownloadUrl, getCmdToolsPath, getCmdToolsStatus, getDeviceInfo, getDisplaySize, getEmulatorDir, getEmulatorStatus, getFreeSpaceBytes, getHdcPath, getHvigorwPath, getImeBundles, getInstalledSdks, getKey, getMainAbility, getOhosBaseSdkHome, getOhpmPath, getOsFolder, getSdkFilename, getSdkRootDir, getSupportedSdksForUi, harmonyOsAutoSign, harmonyOsSdkLabelForApi, hdcClientFailure, hdcExec, hdcTargetArgs, hdcTargetArgsFor, hideKeyboard, hilogTimeMs, installApp, installCmdTools, installEmulator, installFailureReason, installSdkFromArchive, isBundleInstalled, isCmdToolsInstalled, isEmulatorInstalled, isOutOfSpaceError, isRamBackedPath, isUnsignedHap, isUsableDevice, isValidBundleName, isValidProjectName, killProcessTree, launchApp, listAbilities, listDevices, listModules, listRunningProcesses, listTemplates, locateTarget, missingProjectRootFiles, needsCmdWrapper, nonInteractivePrompter, noopLogger, noopProgress, normaliseLocalPath, paramGet, paramGetMany, paramSet, parseBounds, parseCodelinterFindings, parseCodelinterReport, parseDeviceList, parseHilogLine, parseImeBundles, parseMainAbilityFromBmDump, parseParamValues, parseRemoteExit, performInput, pickHap, pickSigningKind, pickTarget, prepareSigning, pruneLayout, readHapBundleName, readJson5File, readJsonFile, readProvisionProfile, readZipEntry, reboot, recvFile, removeCmdTools, removeEmulator, removeSdk, removeTempWorkDir, requireHarmonyOsSdk, resolveDeviceSerial, resolveKeyEvent, resolveTmpRoot, runCodelinter, runHvigorw, runOhpm, runProcess, scopedLogger, selectDevice, sendFile, sendGesture, sendInput, sendRawTouch, setHilogLevel, shell, shellChecked, spawnCompat, startEmulator, staticConfig, stopEmulator, streamHilog, takeScreenshot, toLongPath, toSpaceError, uninstallApp, unsignedHapRejection, validateTemplateLayout, verifySha256, waitForBoot, waitForBundle, waitForCondition, waitForLog, waitForTarget, watchLog, waypointsToRawEvents, withoutWindow, writeJson5File, writeJsonFile };
|
package/dist/index.js
CHANGED
|
@@ -2090,12 +2090,13 @@ async function listDevices(config, opts = {}) {
|
|
|
2090
2090
|
});
|
|
2091
2091
|
return parseDeviceList(res.stdout);
|
|
2092
2092
|
}
|
|
2093
|
+
function isUsableDevice(device) {
|
|
2094
|
+
return device.status === "Connected" || device.status === "Unknown";
|
|
2095
|
+
}
|
|
2093
2096
|
async function selectDevice(config, serial, opts = {}) {
|
|
2094
2097
|
const resolved = resolveDeviceSerial(serial);
|
|
2095
2098
|
if (resolved) return resolved;
|
|
2096
|
-
const usable = (await listDevices(config, opts)).filter(
|
|
2097
|
-
(d) => d.status === "Connected" || d.status === "Unknown"
|
|
2098
|
-
);
|
|
2099
|
+
const usable = (await listDevices(config, opts)).filter(isUsableDevice);
|
|
2099
2100
|
if (usable.length === 1) return usable[0].serial;
|
|
2100
2101
|
if (usable.length === 0) {
|
|
2101
2102
|
throw new OniroError("No connected device found. Connect a device/emulator or set ONIRO_DEVICE_SERIAL.");
|
|
@@ -5227,7 +5228,7 @@ var SIGNING_ERRORS = {
|
|
|
5227
5228
|
DEVICE_ADD: "AppGallery Connect did not register the device.",
|
|
5228
5229
|
DEVICE_LIMIT: "This team has reached its device limit. Remove an unused device in AppGallery Connect and retry.",
|
|
5229
5230
|
DEVICE_NAME_REPEAT: "A device with that name is already registered. Retry.",
|
|
5230
|
-
DEVICE_NONE: "
|
|
5231
|
+
DEVICE_NONE: "This team has no registered device and none could be registered from here, but a debug profile must name at least one. Connect a device that reports a UDID (`hdc shell bm get -u`), or register one in AppGallery Connect, and retry.",
|
|
5231
5232
|
PROFILE_ADD: "AppGallery Connect did not issue the provisioning profile.",
|
|
5232
5233
|
PROFILE_NAME_REPEAT: "A provisioning profile with that name already exists in AppGallery Connect. Retry.",
|
|
5233
5234
|
PROVISION_LIMIT: "This team has reached its debug-profile limit. Delete unused profiles in AppGallery Connect and retry.",
|
|
@@ -5476,21 +5477,31 @@ function parseDeviceKind(stdout) {
|
|
|
5476
5477
|
}
|
|
5477
5478
|
async function collectLocalDevices(config, logger) {
|
|
5478
5479
|
const devices = [];
|
|
5480
|
+
const skipped = [];
|
|
5479
5481
|
for (const target of await listDevices(config, { logger, timeoutMs: 15e3 })) {
|
|
5480
|
-
|
|
5482
|
+
const skip = (why) => {
|
|
5483
|
+
logger.warn(`[harmonyos] ${target.serial} ${why}`);
|
|
5484
|
+
skipped.push(target.serial);
|
|
5485
|
+
};
|
|
5486
|
+
if (!isUsableDevice(target)) {
|
|
5487
|
+
skip(
|
|
5488
|
+
target.status === "Unauthorized" ? "is unauthorized; accept the debugging prompt on the device to register it." : `is ${target.status.toLowerCase()}; skipping it.`
|
|
5489
|
+
);
|
|
5490
|
+
continue;
|
|
5491
|
+
}
|
|
5481
5492
|
const shell2 = async (...args) => (await hdcExec({ config, deviceSerial: target.serial, args: ["shell", ...args], timeoutMs: 15e3, logger })).stdout;
|
|
5482
5493
|
try {
|
|
5483
5494
|
const udid = parseUdid(await shell2("bm", "get", "-u"));
|
|
5484
5495
|
if (!udid) {
|
|
5485
|
-
|
|
5496
|
+
skip("did not report a UDID (`bm get -u`), so it cannot be registered.");
|
|
5486
5497
|
continue;
|
|
5487
5498
|
}
|
|
5488
5499
|
devices.push({ serial: target.serial, udid, kind: parseDeviceKind(await shell2("getprop", "hw_sc.build.os.deviceType")) });
|
|
5489
5500
|
} catch (err) {
|
|
5490
|
-
|
|
5501
|
+
skip(`could not be read: ${err.message}`);
|
|
5491
5502
|
}
|
|
5492
5503
|
}
|
|
5493
|
-
return devices;
|
|
5504
|
+
return { devices, skipped };
|
|
5494
5505
|
}
|
|
5495
5506
|
async function registerDevices(agc, connected, logger) {
|
|
5496
5507
|
let devices = await agc.listDevices();
|
|
@@ -5503,11 +5514,6 @@ async function registerDevices(agc, connected, logger) {
|
|
|
5503
5514
|
if (unregistered.length > 0) devices = await agc.listDevices();
|
|
5504
5515
|
const deviceIds = devices.map((d) => d.id);
|
|
5505
5516
|
if (deviceIds.length === 0) throw new AgcError(SIGNING_ERRORS.DEVICE_NONE);
|
|
5506
|
-
if (connected.length === 0) {
|
|
5507
|
-
logger.warn(
|
|
5508
|
-
`[harmonyos] No device is connected; the profile will name the ${deviceIds.length} device(s) already registered to this team.`
|
|
5509
|
-
);
|
|
5510
|
-
}
|
|
5511
5517
|
return deviceIds;
|
|
5512
5518
|
}
|
|
5513
5519
|
|
|
@@ -5744,7 +5750,7 @@ async function harmonyOsAutoSign(opts) {
|
|
|
5744
5750
|
const aclPermissions = collectAclPermissions(projectDir, logger);
|
|
5745
5751
|
const paths = resolveSigningMaterialPaths(opts.config, productName, projectDir);
|
|
5746
5752
|
logger.info(`[harmonyos] Signing ${bundleName} (product '${productName}', team ${auth.teamId}).`);
|
|
5747
|
-
const
|
|
5753
|
+
const local = await collectLocalDevices(opts.config, logger);
|
|
5748
5754
|
const result = (regenerated) => ({
|
|
5749
5755
|
bundleName,
|
|
5750
5756
|
teamId: auth.teamId,
|
|
@@ -5758,7 +5764,7 @@ async function harmonyOsAutoSign(opts) {
|
|
|
5758
5764
|
productName,
|
|
5759
5765
|
bundleName,
|
|
5760
5766
|
teamId: auth.teamId,
|
|
5761
|
-
connectedUdids:
|
|
5767
|
+
connectedUdids: local.devices.map((d) => d.udid),
|
|
5762
5768
|
aclPermissions,
|
|
5763
5769
|
force: opts.force
|
|
5764
5770
|
});
|
|
@@ -5768,7 +5774,11 @@ async function harmonyOsAutoSign(opts) {
|
|
|
5768
5774
|
}
|
|
5769
5775
|
logger.info(`[harmonyos] Regenerating signing material: ${reason}.`);
|
|
5770
5776
|
const agc = createAgcClient(opts.http ?? createHttpClient({ logger }), auth);
|
|
5771
|
-
const deviceIds = await registerDevices(agc,
|
|
5777
|
+
const deviceIds = await registerDevices(agc, local.devices, logger);
|
|
5778
|
+
if (local.devices.length === 0) {
|
|
5779
|
+
const cause = local.skipped.length > 0 ? "No connected device could be registered" : "No device is connected";
|
|
5780
|
+
logger.warn(`[harmonyos] ${cause}; the profile will name the ${deviceIds.length} device(s) already registered to this team.`);
|
|
5781
|
+
}
|
|
5772
5782
|
for (const file of Object.values(paths)) fs40.rmSync(file, { force: true });
|
|
5773
5783
|
const certName = `oniro_debug_${auth.teamId.replace(/[\\/.:]/g, "")}.cer`;
|
|
5774
5784
|
const stale = (await agc.listCertificates()).find((c) => c.certName === certName);
|
|
@@ -5815,7 +5825,7 @@ async function harmonyOsAutoSign(opts) {
|
|
|
5815
5825
|
}
|
|
5816
5826
|
|
|
5817
5827
|
// src/index.ts
|
|
5818
|
-
var VERSION = "0.15.
|
|
5828
|
+
var VERSION = "0.15.1";
|
|
5819
5829
|
export {
|
|
5820
5830
|
ALL_SDKS,
|
|
5821
5831
|
APL_VALUES,
|
|
@@ -5950,6 +5960,7 @@ export {
|
|
|
5950
5960
|
isOutOfSpaceError,
|
|
5951
5961
|
isRamBackedPath,
|
|
5952
5962
|
isUnsignedHap,
|
|
5963
|
+
isUsableDevice,
|
|
5953
5964
|
isValidBundleName,
|
|
5954
5965
|
isValidProjectName,
|
|
5955
5966
|
killProcessTree,
|