/// <summary>
/// 截取屏幕
/// </summary>
/// <param name="deviceNo"></param>
/// <returns></returns>
public static bool ShotPic(string deviceNo)
{
var result = ProcessHelper.Run(AdbExePath, string.Format("-s {0} shell {1} {2}", deviceNo,"/system/bin/screencap -p ", "/sdcard/screenshot.png"));
m_log.Info("推送PC时结果:" + result.ToString());
if (!result.Success
|| result.ExitCode != 0
|| (result.OutputString != null && result.OutputString.Contains("failed")))
{
return false;
throw new Exception("shell 执行返回的结果异常:" + result.OutputString);
}
/// 截取屏幕
/// </summary>
/// <param name="deviceNo"></param>
/// <returns></returns>
public static bool ShotPic(string deviceNo)
{
var result = ProcessHelper.Run(AdbExePath, string.Format("-s {0} shell {1} {2}", deviceNo,"/system/bin/screencap -p ", "/sdcard/screenshot.png"));
m_log.Info("推送PC时结果:" + result.ToString());
if (!result.Success
|| result.ExitCode != 0
|| (result.OutputString != null && result.OutputString.Contains("failed")))
{
return false;
throw new Exception("shell 执行返回的结果异常:" + result.OutputString);
}