简体   繁体   English

执行大多数命令(例如getprop ro.build.version.release)时,ADB总是崩溃

[英]ADB keeps crashing when executing most commands like getprop ro.build.version.release

I have installed ADB (with SDK manager) on my windows 10 PC and windows 7 laptop in order to run some appium tests. 我已经在Windows 10 PC和Windows 7笔记本电脑上安装了ADB(带有SDK管理器),以便运行一些appium测试。 However, I cannot proceed with tests as ADB constantly crashes whenever command like getprop ro.build.version.release is executed (it actually return the value and then crashes). 但是,我无法继续进行测试,因为只要执行诸如getprop ro.build.version.release之类的命令,ADB都会不断崩溃(它实际上会返回值,然后崩溃)。 The same issue happens with opening device monitors (like scrcpy or appium studio) and many more actions. 打开设备监视器(例如scrcpy或appium studio)以及执行更多其他操作时,也会发生相同的问题。

I am able to execute adb devices succesfully. 我能够成功执行adb设备

I noticed that whenever I run adb shell first and then getprop ro.build.version.release , it returns the value without the crash. 我注意到,每当我先运行adb shell ,然后再运行getprop ro.build.version.release时 ,它都会返回该值而不会崩溃。

By crash I mean "ADB stop working" window. 崩溃是指“ ADB停止工作”窗口。

I use Appium 1.9.1 ADB version 1.0.40 --4986621 Everything up to date in SDK manager 我使用Appium 1.9.1 ADB版本1.0.40 --4986621 SDK管理器中的所有最新信息

Here is log from VS test I try to run: 这是我尝试运行的VS测试的日志:

Message: Test method UnitTestProject1.UnitTest1.TestMethod1 threw exception: System.InvalidOperationException: An unknown server-side error occurred while processing the command. 消息:测试方法UnitTestProject1.UnitTest1.TestMethod1引发异常:System.InvalidOperationException:处理命令时发生未知的服务器端错误。 Original error: Error getting device API level. 原始错误:获取设备API级别时出错。 Original error: Error executing adbExec. 原始错误:执行adbExec时出错。 Original error: 'Command 'H:\\SDK\\platform-tools\\adb.exe -P 5037 -s 520080e95a9c1549 shell getprop ro.build.version.sdk' exited with code 3221226356'; 原始错误:'命令'H:\\ SDK \\ platform-tools \\ adb.exe -P 5037 -s 520080e95a9c1549 shell getprop ro.build.version.sdk'退出,代码为3221226356'' Stderr: ''; 斯特德:''; Code: '3221226356' 编码:'3221226356'

I guess it might be caused by my antivirus software, however I would like to hear any other suggestions as I cannot really change much in AV settings (it's company equipment). 我想这可能是由我的防病毒软件引起的,但是我想听听其他建议,因为我不能真正改变AV设置(这是公司的设备)。

    [TestMethod]
    public void TestMethod1()
    {
        DesiredCapabilities cap = new DesiredCapabilities();
        cap.SetCapability("automationName", "Appium");
        cap.SetCapability("platformName", "Android");
        cap.SetCapability("platformVersion", "7.1.2");
        cap.SetCapability("deviceName", "Redmi 5 Plus");
        cap.SetCapability("udid", "07c92c189805");
        cap.SetCapability("appPackage", "com.android.vending");
        cap.SetCapability("appActivity", "com.android.vending.AssetBrowserActivity");
        cap.SetCapability("noReset", "true");


        driver = new AndroidDriver<IWebElement>(new Uri("http://127.0.0.2:4724/wd/hub"), cap);

        Assert.IsNotNull(driver.Context);

    }

I kind of solved my problem by using older version of ADB: 我通过使用旧版本的ADB解决了我的问题:

Android Debug Bridge version 1.0.36 Revision 0e9850346394-android Android Debug Bridge版本1.0.36修订版0e9850346394-android

It's not the best solution but it does not crash anymore. 这不是最好的解决方案,但是它不再崩溃。

I got the same issue on Appium desktop client and on java automation framework. 我在Appium桌面客户端和Java自动化框架上遇到了相同的问题。 Downgrading the appium to older version on my local and using Android version lesser than 9 helped . 在我的本地将appium降级为较旧版本,并使用小于9的Android版本有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM