未验证 提交 348d37e4 编写于 作者: O openharmony_ci 提交者: Gitee

!19217 更新hidebug js接口示例-3.2release

Merge pull request !19217 from wenlong_12/cherry-pick-1685967602
...@@ -184,18 +184,18 @@ import featureAbility from '@ohos.ability.featureAbility' ...@@ -184,18 +184,18 @@ import featureAbility from '@ohos.ability.featureAbility'
let context = featureAbility.getContext(); let context = featureAbility.getContext();
context.getFilesDir().then((data) => { context.getFilesDir().then((data) => {
var path = data + "/serviceInfo.txt" var path = data + "/serviceInfo.txt";
console.info("output path: " + path) console.info("output path: " + path);
let fd = fs.openSync(path, 0o102, 0o666) let file = fs.openSync(path, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE);
var serviceId = 10 var serviceId = 10;
var args = new Array("allInfo") var args = new Array("allInfo");
try { try {
hidebug.getServiceDump(serviceId, fd, args) hidebug.getServiceDump(serviceId, file.fd, args);
} catch (error) { } catch (error) {
console.info(error.code) console.info(error.code);
console.info(error.message) console.info(error.message);
} }
fs.closeSync(fd); fs.closeSync(file);
}) })
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册