Ability Assistant

Ability Assistant (aa) is a tool used to start applications and test cases. It provides basic application debugging and testing capabilities, for example, starting application components, forcibly stopping processes, and printing application component information.

Environment Setup

Before using this tool, you need to obtain hdc and run the hdc shell command.

The commands in this topic are used in the interactive CLI. To run the hdc shell [aa command] directly, use quotation marks ("") to wrap the aa command to ensure that the input parameters in the command can be correctly identified. The sample code is as follows:

# The start command:
hdc shell "aa start -A ohos.want.action.viewData -U 'https://www.example.com'"

# The process command:
hdc shell "aa process -b com.example.myapplication -a EntryAbility -p perf-cmd"

aa Commands

Command Description
-h/help Displays the help information of the aa tool.
start Starts an application component. The target component can be the PageAbility and ServiceAbility components of the FA model or the UIAbility and ServiceExtensionAbility components of the Stage model. The exported tag in the configuration file of the target component cannot be set to false.
stop-service Stops the service. Stops an application component. The target component can be the ServiceAbility component of the FA model or the ExtensionAbility component of the Stage model.
dump(deprecated) Prints information about an application component.
force-stop Forcibly stops a process based on the bundle name.
test Starts the test framework based on the carried parameters.
attach Attaches an application to enable it to enter the debugging mode.
detach Detaches an application to enable it to exit the debugging mode.
appdebug Sets or cancels the waiting-for-debugging state of an application, and obtains the bundle name and persistence flag of an application in the waiting-for-debugging state. The waiting-for-debugging state takes effect only for debugging applications. The setting command of appdebug takes effect only for a single application. Once the command is executed repeatedly, the bundle name and persistence flag are replaced with the latest settings.
process Debugs or optimizes an application. In DevEco Studio, this command is used to integrate debugging and optimization tools.
send-memory-level Triggers the onMemoryLevel lifecycle callback of a process based on its PID and memory usage level.

help

# Display the help information.
aa help

start

Starts an application component. The target component can be the PageAbility and ServiceAbility components of the FA model or the UIAbility and ServiceExtensionAbility components of the Stage model. The exported tag in the configuration file of the target component cannot be set to false.

# Start an ability explicitly.
# To enable an application clone, use [--pi ohos.extra.param.key.appCloneIndex <unsigned integer-value>] to specify the index of the application clone.
aa start [-d <deviceId>] [-a <abilityName> -b <bundleName>] [-m <moduleName>] [-c] [-E] [-D] [-R] [-S] [-W] [--pi <key> <unsigned integer-value>] [--pb <key> <bool-value: true/false/t/f is case-insensitive] [--ps <key> <value>] [--psn <key>] [--wl <windowLeft>] [--wt <windowTop>] [--wh <windowHeight>] [--ww <windowWidth>] [-p <perf-cmd>]

# Implicitly start an ability. If none of the parameters in the command is set, the startup fails.
aa start [-d <deviceId>] [-U <URI>] [-t <type>] [-A <action>] [-e <entity>] [-c] [-D] [-E] [-R] [--pi <key> <unsigned integer-value>] [--pb <key> <bool-value: true/false/t/f is case insensitive] [--ps <key> <value>] [--psn <key>] [--wl <windowLeft>] [--wt <windowTop>] [--wh <windowHeight>] [--ww <windowWidth>] [-p <perf-cmd>]

Parameters

Name Description
-h/--help Help information.
-d Device ID. This parameter is optional.
-a Ability name. This parameter is optional.
-b Bundle name. This parameter is optional.
-m Module name. This parameter is optional.
-U URI. This parameter is optional.
Note: Only strings can be passed.
-A Action. This parameter is optional.
-e Entity. This parameter is optional.
-t Type. This parameter is optional.
--pi Key-value pair of the integer type. This parameter is optional.
Note: Only unsigned integer values are supported.
--pb Key-value pair of the Boolean type. This parameter is optional.
--ps Key-value pair of the string type. This parameter is optional.
Note: The string value cannot start with a hyphen (-).
--psn Keyword of an empty string. This parameter is optional.
--wl Left margin of the window, in px. This parameter is optional.
Constraints:
This field is valid only when the 2-in-1 device is in developer mode and the application to start uses a debug signature.
--wt Top margin of the window, in px. This parameter is optional.
Constraints:
This field is valid only when the 2-in-1 device is in developer mode and the application to start uses a debug signature.
--wh Window height, in px. This parameter is optional.
Constraints:
This field is valid only when the 2-in-1 device is in developer mode and the application to start uses a debug signature.
--ww Window width, in px. This parameter is optional.
Constraints:
This field is valid only when the 2-in-1 device is in developer mode and the application to start uses a debug signature.
-c Whether to enable ability through cross-device migration during debugging. This parameter is optional. The cross-device migration scenario is used when this parameter is passed in.
-E Whether to display detailed exception information during debugging. This parameter is optional. The detailed exception information is displayed when this parameter is passed in.
NOTE: This parameter is supported since API version 14.
-R Whether to enable multi-thread error detection during debugging. This parameter is optional. The detection is enabled when this parameter is passed in.
NOTE: This parameter is supported since API version 14.
-S Whether to enter the application sandbox during debugging. This parameter is optional. If this parameter is carried, the application sandbox is entered. Otherwise, the application sandbox is not entered.
-D Debugging mode. This parameter is optional.
-N Whether to enable debugging during the startup phase. This parameter is optional.
-C Whether to enable ASan debugging. This parameter is optional.
-p Optimization mode. This parameter is optional. This command can be customized.
-W Optimization mode. This parameter is optional. It measures the time taken for a UIAbility to launch and transition to the foreground.
NOTE
  - This parameter is supported since API version 20.
  - This parameter is valid only when the UIAbility starts explicitly (the -b and -a parameters must be passed in).
In normal cases, the following information is displayed:
  - StartMode: UIAbility startup mode. The value can be Cold or Hot.
  - BundleName: bundle name of the target application.
  - AbilityName: ability name of the target application.
  - ModuleName: module name of the target application. If the command contains the -m parameter, moduleName is printed.
  - TotalTime:
   Cold start scenario: duration from when the system receives the request for starting the UIAbility from AA to when the first frame of the UIAbility is drawn, in ms.
   Hot start scenario: duration from when the system receives the request for starting the UIAbility from AA to when the UIAbility is switched to the foreground, in ms.
  - WaitTime: duration from when the command starts to when the command execution is complete, in ms.
If an exception occurs, the following information is displayed:
  - "The wait option does not support starting implicit": Implicit startup is not supported.
  - "The wait option does not support starting non-uiability": Non-UIAbility components cannot be started.

Return value

If the ability is started successfully, "start ability successfully." is returned; otherwise, the error message "error: failed to start ability." and the corresponding error information are returned.

Error codes

ID Error Message
10103001 Failed to verify the visibility of the target ability.
10104001 The specified ability does not exist.
10105001 Failed to connect to the ability service.
10105002 Failed to obtain ability information.
10106002 The aa start command's window option or the aa test command does not support app with release signature.
10100101 Failed to obtain application information.
10100102 The aa start command cannot be used to launch a UIExtensionAbility.
10103101 Failed to find a matching application for implicit launch.
10103102 The passed appCloneIndex is invalid.
10106101 The current ability will be placed in the queue to wait for the previous ability to finish launching.
10106102 The device screen is locked during the application launch.
10106103 The target application is an expired crowdtesting application.
10106105 The target application is under control.
10106106 The target application is managed by EDM.
10106107 The current device does not support using window options.
10107102 Permission verification failed for the specified process.
10108101 An internal error occurs while attempting to launch the ability.

Example

The following uses the implicit startup of an ability as an example.

NOTE

This example describes only the usage of some fields. For details about ability matching rules, see Matching Rules of Explicit Want and Implicit Want.

  • Configure uris for the target ability in the module.json5 file.

    {
      "name": "TargetAbility",
      // ......
      "exported": true,
      "skills": [
        {
          "actions":[
            "ohos.want.action.viewData"
          ],
          "uris":[
            {
              "scheme": "myscheme",
              "host": "www.test.com",
              "port": "8080",
              "path": "path"
            }
          ]
        }
      ]
    }
    
  • Implicitly start the ability.

    • Run the -U command to start an application page.

      aa start -U myscheme://www.test.com:8080/path
      
    • If parameters need to be carried, run the following command:

      aa start -U myscheme://www.test.com:8080/path --pi paramNumber 1 --pb paramBoolean true --ps paramString teststring  --psn paramNullString
      

      The following is an example for the UIAbility to obtain input parameters:

      import { UIAbility, Want, AbilityConstant } from '@kit.AbilityKit';
      import { hilog } from '@kit.PerformanceAnalysisKit';
      
      export default class TargetAbility extends UIAbility {
        onCreate(want:Want, launchParam: AbilityConstant.LaunchParam) {
          hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
          let paramNumber = want.parameters?.paramNumber;
          let paramBoolean = want.parameters?.paramBoolean;
          let paramString = want.parameters?.paramString;
          let paramNullString = want.parameters?.paramNullString;
        }
      }
      
    • Run the -A -U command to start the browser and redirect to a specified page.

      The following uses https://www.example.com as an example. Replace it with the actual URL.

      aa start -A ohos.want.action.viewData -U https://www.example.com
      

stop-service

Stops the service. Stops an application component. The target component can be the ServiceAbility component of the FA model or the ExtensionAbility component of the Stage model.

aa stop-service [-d <deviceId>] -a <abilityName> -b <bundleName> [-m <moduleName>]

Parameters

Name Description
-h/--help Help information.
-d Device ID. This parameter is optional.
-a Ability name. This parameter is mandatory.
-b Bundle name. This parameter is mandatory.
-m Module name. This parameter is optional.

Return value

"stop service ability successfully." is returned if the ServiceAbility or ExtensionAbility is stopped; "error: failed to stop service ability." is returned otherwise.

Error codes

ID Error Message
10103001 Failed to verify the visibility of the target ability.
10103201 The target ability is not of the ServiceAbility type.
10104001 The specified ability does not exist.
10105001 Failed to connect to the ability service.
10105002 Failed to obtain ability information.

Example

# Stop a ServiceAbility.
aa stop-service -a EntryAbility -b com.example.myapplication -m entry

dump(deprecated)

Prints information about an application component.

aa dump -a

NOTE

This command is supported since API version 7 and deprecated since API version 9. You are advised to use hidumper -s AbilityManagerService instead.

Parameters

Name Level-2 Parameter Description
-h/--help - Help information.
-a/--all - Application component information in all missions.
-l/--mission-list type (All logs are printed if this parameter is left unspecified.) For better management, the service side maintains four types of MissionLists,
as described below:
- NORMAL: MissionList that is started normally. For example, if A starts B and C, the corresponding MissionList is A->B->C.
- DEFAULT_STANDARD: If a MissionList is damaged, missions with the launch type set to multiton are removed to this MissionList. The Missions in it are not associated with each other.
- DEFAULT_SINGLE: If a MissionList is damaged, missions with the launch type set to singleton are removed to this MissionList. The Missions in it are not associated with each other.
- LAUNCHER: MissionList for launcher abilities.
-e/--extension elementName Extended component information.
-u/--userId UserId Mission stack information of a specified user ID. This parameter must be used together with other parameters. Example commands: aa dump -a -u 100 and aa dump -d -u 100.
-d/--data - DataAbility information.
-i/--ability AbilityRecord ID Detailed information about an application component.
-c/--client - Detailed information about an application component. This parameter must be used together with other parameters. Example commands: aa dump -a -c and aa dump -i 21 -c.
-p/--pending - Pending Want information. This parameter must be used together with other parameters. Example command: aa dump -a -p.
-r/--process - Process information. This parameter must be used together with other parameters. Example command: aa dump -a -r.

Error codes

ID Error Message
10105001 Failed to connect to the ability service.

Example

# Print the application component information in all missions.
aa dump -a

aa-dump-a

# Print all task chains.
aa dump -l

aa-dump-l

# Print the detailed information about an application component.
aa dump -i 105

aa-dump-i

force-stop

Forcibly stops a process based on the bundle name.

aa force-stop <bundle-name> [-p pid] [-r kill-reason]

Parameters

Name Description
-p PID. This parameter must be used together with -r to set the exit reason of the process with the specified PID.
-r Exit reason of the process. This parameter must be used together with -p to set the exit reason of the process with the specified PID.

Return value

"force stop process successfully." is returned if the process is forcibly stopped; "error: failed to force stop process." is returned otherwise.

Error codes

ID Error Message
10105001 Failed to connect to the ability service.
10104002 Failed to retrieve specified package information.
10106401 Failed to terminate the process.
10106402 Persistent processes cannot be terminated.

Example

# Forcibly stop a process based on the bundle name.
aa force-stop com.example.myapplication

test

Starts the test framework based on the carried parameters.

aa test -b <bundleName> [-m <module-name>] [-p <package-name>] [-s class <test-class>] [-s level <test-level>] [-s size <test-size>] [-s testType <test-testType>] [-s timeout <test-timeout>] [-s <any-key> <any-value>] [-w <wait-time>] -s unittest <testRunner>

NOTE

For details about parameters such as class, level, size, and testType, see Parameters in the aa test Commands.

Parameters

Name Description
-h/--help Help information.
-b Bundle name. This parameter is mandatory.
-s unittest Test runner. This parameter is mandatory.
-p Package name of the test runner. This parameter is optional.
NOTE: This parameter can be used only in the FA model.
-m Module name of the test runner. This parameter is optional.
NOTE: This parameter can be used only in the stage model.
-s class Test suite or test case to be executed. This parameter is optional.
-s level Level of the test case to be executed. This parameter is optional.
-s size Size of the test case to be executed. This parameter is optional.
-s testType Type of the test case to be executed. This parameter is optional.
-s timeout Timeout interval for executing the test case, in ms. The default value is 5000. This parameter is optional.
-s <any-key> Any key-value pair. This parameter is optional.
-w Test running time, in ms. This parameter is optional.
-D Debugging mode. This parameter is optional.

Return value

"user test started." is returned if the test framework is started; "error: failed to start user test." and the corresponding error information are returned otherwise.

Error codes

ID Error Message
10104002 Failed to retrieve specified package information.
10105001 Failed to connect to the ability service.
10106002 The aa start command's window option or the aa test command does not support app with release signature.
10108501 An internal error occurs during the execution of the aa test command.

Example

# Start the test framework.
aa test -b com.example.myapplication -s unittest ActsAbilityTest
# Start the test framework and set the module name.
aa test -b com.example.myapplication -m entry_test -s unittest ActsAbilityTest
# Start the test framework and specify the timeout interval.
aa test -b com.example.myapplication -m entry_test -s timeout 10000 -s unittest ActsAbilityTest

attach

Attaches an application to enable it to enter the debugging mode.

aa attach -b <bundleName>

Parameters

Name Description
-h/--help Help information.
-b Bundle name. This parameter is mandatory.

Return value

"attach app debug successfully." is returned if the application enters the debugging mode; "fail: unknown option." and the help information are returned if the specified parameter is invalid.

Error codes

ID Error Message
10105001 Failed to connect to the ability service.
10106001 The current device is not in developer mode.
10106002 The aa start command's window option or the aa test command does not support app with release signature.
10103601 The specified bundleName does not exist.
10108601 An internal error occurs while attempting to enter/exit debug mode.

Example

# Attach an application to enable it to enter the debugging mode.
aa attach -b com.example.myapplication

detach

Detaches an application to enable it to exit the debugging mode.

aa detach -b <bundleName>

Parameters

Name Description
-h/--help Help information.
-b Bundle name. This parameter is mandatory.

Return value

"detach app debug successfully." is returned if the application exits the debugging mode; "fail: unknown option." and the help information are returned if the specified parameter is invalid.

Error codes

ID Error Message
10105001 Failed to connect to the ability service.
10106001 The current device is not in developer mode.
10106002 The aa start command's window option or the aa test command does not support app with release signature.
10103601 The specified bundleName does not exist.
10108601 An internal error occurs while attempting to enter/exit debug mode.

Example

# Detach an application to enable it to exit the debugging mode.
aa detach -b com.example.myapplication

appdebug

Sets or cancels the waiting-for-debugging state of an application, and obtains the bundle name and persistence flag of an application in the waiting-for-debugging state. The waiting-for-debugging state takes effect only for debugging applications. The setting command of appdebug takes effect only for a single application. Once the command is executed repeatedly, the bundle name and persistence flag are replaced with the latest settings.

aa appdebug -b <bundleName> [-p]

Parameters

Name Level-2 Parameter Description
-h/--help - Help information.
-b/--bundlename bundleName Bundle name for which the waiting-for-debugging state is set. The system does not verify the validity of the bundle name.
-p/--persist - Persistence flag. This parameter is optional. If this parameter is carried, the application is set to the waiting-for-debugging state persistently. That is, the setting takes effect regardless of whether the device is restarted or the application is reinstalled. If this parameter is not carried, the state takes effect only before the device is restarted. This parameter must be used together with the -b parameter. Example command: aa appdebug -b <bundleName> -p.
-c/--cancel - Used to cancel the waiting-for-debugging state.
-g/--get - Used to obtain the bundle name and persistence flag of an application in the waiting-for-debugging state.

Return value

"app debug successfully." is returned if the operation is successful; "error: not developer mode." is returned if the operation fails because the application is not in developer mode; "error: failed to app debug." is returned if the operation fails due to other reasons.

Error codes

ID Error Message
10105003 Failed to connect to the app service.
10106001 The current device is not in developer mode.
10106701 Cannot debug applications using a release certificate.

Example

# Display the help information.
aa appdebug -h

# Set the waiting-for-debugging state for an application.
aa appdebug -b com.example.myapplication [-p]

# Cancel the waiting-for-debugging state.
aa appdebug -c

# Obtain the bundle name and persistence flag of an application in the waiting-for-debugging state.
# Example of the obtained information: bundle name: com.example.publishsystem, persist: false
aa appdebug -g

process

Debugs or optimizes an application. In DevEco Studio, this command is used to integrate debugging and optimization tools.

# Debug an application.
aa process -b <bundleName> -a <abilityName> [-m <moduleName>] [-D <debug-cmd>] [-S]

# Optimize an application.
aa process -b <bundleName> -a <abilityName> [-m <moduleName>] [-p <perf-cmd>] [-S]

Parameters

Name Description
-h/--help Help information.
-b Bundle name. This parameter is mandatory.
-a Ability name. This parameter is mandatory.
-m Module name. This parameter is optional.
-p Optimization mode. This parameter is optional. Either this parameter or -D must be specified. This command can be customized.
-D Debugging mode. This parameter is optional. Either this parameter or -p must be specified. This command can be customized.
-S Used to enter the application sandbox. This parameter is optional.

Return value

"start native process successfully." is returned if this command is executed successfully; "error: failed to start native process." is returned if this command fails to be executed; "error: option requires a value." and the help information are returned if the specified parameter is invalid.

ID Error Message
10105002 Failed to obtain ability information.
10105003 Failed to connect to the app service.
10106002 The aa start command's window option or the aa test command does not support app with release signature.

Example

# Debug an application.
aa process -b com.example.myapplication -a EntryAbility -D debug_cmd [-S]

# Optimize an application.
aa process -b com.example.myapplication -a EntryAbility -p perf-cmd [-S]

send-memory-level

Since API version 13, you can use this command to debug the onMemoryLevel lifecycle of an application. You can specify the PID and memory usage level of a process to trigger the onMemoryLevel lifecycle callback of the process. This command provides only basic application debugging capabilities and cannot completely simulate real memory pressure test scenarios.

# Trigger the onMemoryLevel callback.
aa send-memory-level -p <processId> -l <memoryLevel>

Parameters

Name Description
-h/--help Help information.
-p PID of a process. This parameter is mandatory.
-l Memory usage level. This parameter is mandatory. For details, see AbilityConstant.MemoryLevel.

Return value

"send memory level successfully." is returned if the command is executed successfully; "error: failed to send memory level." is returned if the command fails to be executed; "fail: unknown option." and the help information are returned if the specified parameter value is missing.

ID Error Message
10104003 The specified pid does not exist.
10104004 The specified level does not exist.

Example

# Trigger the onMemoryLevel callback of the application whose process ID is 6066. The callback level is 0.
aa send-memory-level -p 6066 -l 0

Error Codes

10103001 Failed to Verify the Visibility of the Target Ability

Error Message

Failed to verify the visibility of the target ability.

Symptom

The verification of the target ability visibility fails.

Possible Causes

The exported field of the abilities or extensionAbilities tag in the module.json5 file is set to false. As a result, the corresponding UIAbility or ExtensionAbility component cannot be invoked by other applications or started by the aa command.

Solution

Check whether the exported field of the ability in the module.json5 file of the target application is true. If not, change it to true and try again.

10104001 The Ability Does Not Exist

Error Message

The specified ability does not exist.

Symptom

The specified ability name does not exist.

Possible Causes

The specified ability is not installed.

Solution

  1. Check whether the -a parameter abilityName and the -b parameter bundleName in the aa command are correct.
  2. Check whether the application corresponding to the specified bundleName is installed. You can run the following command to query the list of installed applications. If bundleName is not in the query result, the application is not installed.
    hdc shell bm dump -a
    
  3. For a multi-HAP application, check whether the HAP to which the ability belongs is installed. You can run the following command to query the bundle information. If the installed application does not contain the corresponding HAP and ability, the HAP to which the ability belongs is not installed.
    hdc shell bm dump -n bundleName
    

10104003 The Specified PID Does Not Exist

Error Message

The specified pid does not exist.

Symptom

The specified PID does not exist.

Possible Causes

The specified PID does not exist.

Solution

Check whether the process ID specified by the -p parameter exists on the device.

10104004 The Specified Memory Usage Level Does Not Exist

Error Message

The specified level does not exist.

Symptom

The specified memory usage level does not exist.

Possible Causes

The specified memory usage level does not exist.

Solution

Check whether the memory usage level specified by the -l parameter is an integer within the range of [0, 2].

10105001 Failed to Connect to the Ability Service

Error Message

Failed to connect to the ability service.

Symptom

The connection to the Ability service fails.

Possible Causes

The Ability service is disconnected when the API is called.

Solution

Restart the device and try again.

10105002 Failed to Obtain Ability Information

Error Message

Failed to obtain ability information.

Symptom

The Ability information fails to be obtained.

Possible Causes

The AbilityInfo obtained through BMS is empty when the ability request is generated.

Solution

Check whether the application corresponding to the specified bundleName is installed. You can run the following command to query the list of installed applications. If bundleName is not in the query result, the application is not installed.

hdc shell bm dump -a

10105003 Failed to Connect to the Application Service

Error Message

Failed to connect to the app service.

Symptom

The connection to the app service fails.

Possible Causes

The application service is disconnected when the API is called.

Solution

Restart the device.

10106001 The Current Device Is Not in Developer Mode

Error Message

The current device is not in developer mode.

Symptom

The current device is not in developer mode.

Possible Causes

The current device is not in developer mode.

Solution

Enable the developer mode in Settings. Perform the following operations:

Check whether Developer options is available in Settings > System. If not, go to Settings > About phone and tap the build number seven times in quick succession until a message is displayed to indicate that Developer options has been enabled, and then tap the confirm button. If prompted, enter the PIN. Your device will automatically restart. Wait until the restart is complete. You can check the status in Settings > System.

10106002 Applications Cannot Be Signed by the Release Certificate

Error Message

The aa start command's window option or the aa test command does not support app with release signature.

Symptom

The wl, wt, wh, and ww parameters in the aa start command, or the aa test command cannot be used for applications signed by the release certificate.

Possible Causes

The target application is signed by the release certificate.

Solution

Use the signing certificate of the debug type and install the newly signed HAP. Then, run the command again.

10100101 Failed to Obtain Application Information

Error Message

Failed to obtain application information.

Symptom

The application information obtained from BMS is abnormal.

Possible Causes

The application name or bundle name in the app information obtained from BMS is incorrect.

Solution

  1. Check whether the -a parameter abilityName and the -b parameter bundleName in the aa command are correct.
  2. Check whether the application corresponding to the specified bundleName is installed. You can run the following command to query the list of installed applications. If bundleName is not in the query result, the application is not installed.
    hdc shell bm dump -a
    
  3. For a multi-HAP application, check whether the HAP to which the ability belongs is installed. You can run the following command to query the bundle information. If the installed application does not contain the corresponding HAP and ability, the HAP to which the ability belongs is not installed.
    hdc shell bm dump -n bundleName
    

10100102 UIExtensionAbility Cannot Be Launched Using the aa start Command

Error Message

The aa start command cannot be used to launch a UIExtensionAbility.

Symptom

The aa tool cannot launch a UIExtensionAbility.

Possible Causes

The aa start command cannot be used to launch the UIExtensionAbility.

Solution

Check whether the target ability is a UIExtensionAbility. The aa start command cannot start the UIExtensionAbility.

10103101 No Matching Application Is Found During Implicit Launch

Error Message

Failed to find a matching application for implicit launch.

Symptom

A matching ability is not found during implicit launch.

Possible Causes

  • The implicit launch parameters are incorrectly configured or the specified HAP is not installed.
  • If the application is launched explicitly, it is possible that bundleName is specified but abilityName is not specified in the command.

Solution

  • For implicit launch, ensure that the launch parameters are set correctly and the specified HAP is installed.
  • For explicit launch, ensure that the value of abilityName is correct.

10103102 The Value of AppCloneIndex Is Invalid

Error Message

The passed appCloneIndex is invalid.

Symptom

The value of appCloneIndex is invalid.

Possible Causes

The AppCloneIndex parameter in the aa start command is invalid.

Solution

Check whether the AppCloneIndex parameter is valid.

10106101 Waiting for the Previous Abilities to Finish Startup

Error Message

The current ability will be placed in the queue to wait for the previous ability to finish launching.

Symptom

Too many abilities need to be started. Due to the limited processing capability of the system, the requests are cached in the queue and processed in sequence.

Possible Causes

The system has a large number of concurrent requests.

Solution

No action is required. Wait for the previous abilities to finish startup.

10106102 The Device Is Locked During Application Launch

Error Message

The device screen is locked during the application launch.

Symptom

The device is locked during application launch.

Possible Causes

The device cannot be unlocked during application launch.

Solution

Unlock the device and launch the application.

10106103 The Target Application Is an Expired Crowdtesting Application

Error Message

The target application is an expired crowdtesting application.

Symptom

The target application is an expired crowdtesting application.

Possible Causes

The crowdtesting application has expired.

Solution

Check whether the crowdtesting application has expired. Expired crowdtesting applications cannot be started.

10106105 The Target Application Is Controlled

Error Message

The target application is under control.

Symptom

The application is controlled by the application market.

Possible Causes

  • The target application is suspected to have malicious behavior and is not allowed to start due to application market control.
  • The target application is a pre-installed system application, and it is overwritten by a locally compiled version.

Solution

  • For possible cause 1, you are advised to uninstall the application.
  • For possible cause 2, you need to uninstall the application and then install it using the locally compiled version.

10106106 The Target Application Is Managed by EDM

Error Message

The target application is managed by EDM.

Symptom

This target application is managed by Enterprise Device Management (EDM).

Possible Causes

The target application is forbidden to start by EDM.

Solution

The device is an enterprise device, and the target application is forbidden to start. You cannot handle it.

10106107 The Current Device Does Not Support Window Options

Error Message

The current device does not support using window options.

Symptom

The device does not support window options.

Possible Causes

The device does not support WindowOptions specified in the aa start command.

Solution

Delete the wl, wt, wh, and ww parameters from the aa start command.

10107102 Process Permission Verification Failure

Error Message

Permission verification failed for the specified process.

Symptom

Permission verification for the specified process fails.

Possible Causes

Permission verification for the specified process fails.

Solution

Check whether the permission of the specified process is correct.

10108101 Internal Error During Ability Launch

Error Message

An internal error occurs while attempting to launch the ability.

Symptom

An error occurs during internal processing, such as memory allocation or multithreaded processing.

Possible Causes

Common kernel errors such as memory application and multi-thread processing errors occur. The specific causes are as follows: empty internal object, processing timeout, failure in obtaining application information, failing in obtaining the system service, and too many started ability instances.

Solution

You cannot handle internal errors that occur during system running.

10103201 The Target Ability Is Not of the ServiceAbility Type

Error Message

The target ability is not of the ServiceAbility type.

Symptom

The target ability is not of the ServiceAbility type.

Possible Causes

When the aa stop command is used to stop a ServiceAbility, the ability specified by abilityName in the -a parameter is not a ServiceAbility.

Solution

Check whether the ability corresponding to the abilityName parameter in the aa -a command is a ServiceAbility.

10104002 Failed to Obtain Information About a Specified Bundle

Error Message

Failed to retrieve specified package information.

Symptom

Information about the specified bundle fails to be obtained.

Possible Causes

The application corresponding to the specified bundle name is not installed.

Solution

  1. Check whether the specified bundle name is correct.
  2. Check whether the application corresponding to the specified bundleName is installed. You can run the following command to query the list of installed applications. If bundleName is not in the query result, the application is not installed.
    hdc shell bm dump -a
    

10106401 Failed to Terminate the Process

Error Message

Failed to terminate the process.

Symptom

The process fails to be terminated.

Possible Causes

  1. The application specified by the aa force-stop command does not exist.
  2. AppManagerService is not connected.

Solution

  1. Check whether the application corresponding to the specified bundleName is installed. You can run the following command to query the list of installed applications. If bundleName is not in the query result, the application is not installed.

    hdc shell bm dump -a
    
  2. Restart the device.

10106402 Persistent Processes Cannot Be Terminated

Error Message

Persistent processes cannot be terminated.

Symptom

Persistent processes cannot be killed.

Possible Causes

The process specified by bundleName in the aa force-stop command is a persistent process.

Solution

Check whether the target application is a persistent process. Persistent processes cannot be terminated by running commands.

Solution

Close the multiple instances of the target application and try again.

10108501 Internal Error During the Execution of the aa test Command

Error Message

An internal error occurs during the execution of the aa test command.

Symptom

An error occurs during internal processing, such as memory allocation or multithreaded processing.

Possible Causes

Common kernel errors such as memory application and multi-thread processing errors occur. The specific causes are as follows: empty internal object, processing timeout, and failing in obtaining the system service.

Solution

You cannot handle internal errors that occur during system running.

10108601 Internal Error During Entering or Exiting the Debug Mode

Error Message

An internal error occurs while attempting to enter/exit debug mode.

Symptom

An error occurs during internal processing, such as memory allocation or multithreaded processing.

Possible Causes

Common kernel errors such as memory application and multi-thread processing errors occur. The specific causes are as follows: empty internal object, processing timeout, and failing in obtaining the system service.

Solution

You cannot handle internal errors that occur during system running.

10103601 The Specified Bundle Name Does Not Exist

Error Message

The specified bundleName does not exist.

Symptom

The specified bundle name is not found.

Possible Causes

The bundle name specified by the aa attach or aa detach command does not exist.

Solution

Check whether the application corresponding to the specified bundleName is installed. You can run the following command to query the list of installed applications. If bundleName is not in the query result, the application is not installed.

hdc shell bm dump -a

10106701 The Target Application Is Not a Debug Application

Error Message

Cannot debug applications using a release certificate.

Symptom

The target application is not a debug application.

Possible Causes

The value of the type parameter in the signing tool is not debug.

Solution

Use the signing certificate of the debug type and install the newly signed HAP. Then, run the command again.

For details about the signing tool and certificate, see Signing Your App/Atomic Service.