For large apps, the process of rebuilding, pushing packages, and installing after each code modification can be time-consuming. To address this issue, incremental debugging is provided in both DevEco Studio and command line. After code is modified, the debugger can identify code differences and build and push only the incremental package for debugging.
Incremental debugging of C++ code is available for projects developed using API version 11 or later based on the stage model. Incremental debugging of ArkTS code, specifically for modifications to resource files, is available for projects developed using API version 12 or later based on the stage model.
Run or
Debug.
Apply Changes.Then, DevEco Studio initiates an incremental build task, building an incremental package in HQF format. Once the incremental package is built, it will be pushed and installed on the device.

The Apply Changes feature temporarily does not support the creation and deletion of code files, modifications related to decorators, or adding new references using import statements in code files.
Run or
Debug.
Apply Changes to push the incremental package to the device.Then, DevEco Studio initiates an incremental build task, building an incremental package in HQF format. Once the incremental package is built, it will be pushed and installed on the device.
hvigorw --mode module -p module=entry@default,library@default -p product=default assembleHap assembleHsp --info --no-daemon
$ hdc shell mkdir data/local/tmp/99c24fdc44694c05be12491d0a48e139 $ hdc file send library-default-signed.hsp "data/local/tmp/99c24fdc44694c05be12491d0a48e139" $ hdc file send entry-default-signed.hap "data/local/tmp/99c24fdc44694c05be12491d0a48e139" $ hdc shell bm install -p "data/local/tmp/99c24fdc44694c05be12491d0a48e139"
hvigorw --mode module -p module=entry@default,library@default -p product=default assembleDevHqf --info --no-daemon
$ hdc shell mkdir data/local/tmp/3b7d97cdf4de41c4aecc465ff5069708 $ hdc file send library-default-signed.hqf "data/local/tmp/3b7d97cdf4de41c4aecc465ff5069708" $ hdc file send entry-default-signed.hqf "data/local/tmp/3b7d97cdf4de41c4aecc465ff5069708" $ bm quickfix -a -f "data/local/tmp/3b7d97cdf4de41c4aecc465ff5069708"

hdc bm install ***.hap (HAP/HSP path on the PC) hdc shell bm install -p hap_path (installation package directory on the device)
You can obtain the corresponding signature file from the project's build-profile.json5 file.
{
"app" : {
"bundleName" : "com.ohos.quickfix",
"versionCode" : 1000000, // App version
"versionName" : "1.0.0.1",
"patchVersionCode" : 1000000, // Patch version
"patchVersionName" : "1.0.0.1"
},
"module" : {
"name" : "entry",
"type" : "patch",
"deviceTypes" : [
"default",
"tablet"
],
"originalModuleHash" : "" // SHA-256 value of the HAP to be fixed; leave it empty
}
} java -jar app_packing_tool.jar --mode hqf --json-path patch.json --lib-path libs --out-path entry-default-unsigned.hqf --force true
--mode: packaging mode, the value being hqf here; mandatory.
--json-path: incremental package information, the value being patch.json here; mandatory. For details, see Step 4.
--lib-path: path to the .so files to be packaged. For details, see Step 2.
--out-path: output path for the .hqf package.
java -jar hap-sign-tool.jar sign-app -keyAlias "OpenHarmony Application Release" -signAlg "SHA256withECDSA" -mode "localSign" -appCertFile "OpenHarmonyApplication.pem" -profileFile "ohos_provision_release.p7b" -inFile "entry-default-unsigned.hqf" -keystoreFile "OpenHarmony.p12" -outFile "entry-signed-release.hqf" -keyPwd "123456" -keystorePwd "123456" -signCode 1
In the preceding command, modify settings of the following parameters and keep the other parameters as they are:
bm quickfix -a -f /data/entry-signed-release.hqf
bm quickfix -f, --file-path <bundle-direction>
Symptom
If the .so file is modified and packed by using other development tools, the incremental debugging feature of DevEco Studio 4.1 Canary2 does not work.
Solution
In DevEco Studio 4.1 Canary2, if the native file exceeds 16 KB, the LLDB debugger holds the file handle by default when a breakpoint is hit. As a result, the file cannot be modified or saved during debugging.
You can use either of the following methods to solve the problem:
settings set use-source-cache false