Only HarmonyOS NEXT 5.0.0.25 or later versions are supported.
For details about how to capture frames on non-rooted devices running HarmonyOS NEXT 6.0 or later, see section 4.6.2.2.
OpenGL ES applications:
Copy the libsquid.so file in the <installation_folder>/frame_profiler/plugins/ohos/arm64 directory to the libs/arm64-v8a folder of the HAP.
Vulkan applications:

// In the Index.ets file:
import fs from '@ohos.file.fs';
uiContext = this.getUIContext();
// ...
aboutToAppear(): void {
let path = this.uiContext?.getHostContext()?.filesDir;
let buffer = this.uiContext?.getHostContext()?.resourceManager.getRawFileContentSync('squid.json') ;
let file = fs.openSync(path + '/squid.json', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE);
fs.writeSync(file.fd, buffer?.buffer);
}
// ...