bytearray shell execution added

This commit is contained in:
Gergő Törcsvári
2016-02-28 10:54:33 +01:00
parent 5ab126ddbe
commit 722ecc4f8b
3 changed files with 56 additions and 12 deletions

View File

@ -1,8 +1,11 @@
package se.vidstige.jadb.test;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.junit.Test;
import se.vidstige.jadb.JadbDevice;
@ -92,4 +95,13 @@ public class RealDeviceTestCases {
String s2=any.executeShell("ls");
System.out.println(s2);
}
@Test
public void testShellArray() throws Exception
{
JadbConnection jadb = new JadbConnection();
JadbDevice any = jadb.getAnyDevice();
byte[] s=any.executeShellGetBytearr("screencap -p");
FileUtils.writeByteArrayToFile(new File("screen.png"), s);
}
}