1 Star 1 Fork 2

ruida/APP性能测试初探索

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ScreenRecord.java 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
myself 提交于 2017-12-12 15:33 +08:00 . d
package monkeytest;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import source.Common;
public class ScreenRecord extends Thread {
@Override
public void run() {
Common.getInstance().sleep(300);
execCmdAdb("adb shell screenrecord --time-limit 10 --size 960x640 --bit-rate 2000000 /sdcard/123/" + getNow()
+ ".mp4");
}
private static void execCmdAdb(String cmd) {
System.out.println(cmd);
String OSname = System.getProperty("os.name");
try {
if (OSname.contains("Mac")) {
Runtime.getRuntime().exec(Common.ADB_PATH + cmd);
} else {
Runtime.getRuntime().exec("cmd /c " + cmd);
}
} catch (IOException e) {
Common.getInstance().output("执行" + cmd + "失败!");
e.printStackTrace();
}
}
/**
* 获取当前时间
*
* @return 返回当前时间,只有日期和小时和分数没有年份和秒数
*/
private static String getNow() {
Date time = new Date();
SimpleDateFormat now = new SimpleDateFormat("MM-dd-HH-mm");
String c = now.format(time);
return c;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/heruida/performancefirsttest.git
git@gitee.com:heruida/performancefirsttest.git
heruida
performancefirsttest
APP性能测试初探索
master

搜索帮助