未验证 提交 5712ea00 编写于 作者: 卢韬 提交者: Gitee

change FA interface to Stage

Signed-off-by: N卢韬 <lutao31@huawei.com>
上级 18c1379e
......@@ -175,23 +175,30 @@ getServiceDump(serviceid : number, fd : number, args : Array\<string>) : void
```js
import fs from '@ohos.file.fs'
import hidebug from '@ohos.hidebug'
import featureAbility from '@ohos.ability.featureAbility'
let context = featureAbility.getContext();
context.getFilesDir().then((data) => {
var path = data + "/serviceInfo.txt";
console.info("output path: " + path);
let file = fs.openSync(path, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE);
var serviceId = 10;
var args = new Array("allInfo");
try {
hidebug.getServiceDump(serviceId, file.fd, args);
} catch (error) {
console.info(error.code);
console.info(error.message);
}
fs.closeSync(file);
})
import common from '@ohos.app.ability.common'
let applicationContext: common.Context;
try {
applicationContext = this.context.getApplicationContext();
} catch (error) {
console.info(error.code);
console.info(error.message);
}
var filesDir = applicationContext.filesDir;
var path = filesDir + "/serviceInfo.txt";
console.info("output path: " + path);
let file = fs.openSync(path, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE);
var serviceId = 10;
var args = new Array("allInfo");
try {
hidebug.getServiceDump(serviceId, file.fd, args);
} catch (error) {
console.info(error.code);
console.info(error.message);
}
fs.closeSync(file);
```
## hidebug.startJsCpuProfiling<sup>9+</sup>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册