“11f9f5fb172f620d5221c93fe26196ebd244df79”上不存在“paddle/git@gitcode.net:Crayonxin2000/Paddle.git”
提交 f97a83d2 编写于 作者: W wenlong12

更新hidebug js接口示例

Signed-off-by: Nwenlong12 <wenlong12@huawei.com>
Signed-off-by: Nwenlong12 <wenlong12@huawei.com>
上级 0094872e
...@@ -179,18 +179,18 @@ import featureAbility from '@ohos.ability.featureAbility' ...@@ -179,18 +179,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.
先完成此消息的编辑!
想要评论请 注册