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