【发布时间】:2014-01-12 14:19:08
【问题描述】:
我想每 10 秒自动截取一次 android 设备的屏幕截图,然后将它们保存到一个目录中。 我使用了这个方法,但它不起作用 谁能帮帮我!!!
Process sh = Runtime.getRuntime().exec("su");
OutputStream os = sh.getOutputStream();
os.write(("/system/bin/screencap -p /mnt/sdcard/img.png").getBytes("ASCII"));
os.flush();
os.close();
try {
sh.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
}
【问题讨论】:
-
这是一个应用程序吗?或用于测试目的?还是其他?
-
什么不起作用?你有任何错误吗?如果屏幕截图部分不起作用,请参阅副本。
标签: android screenshot