当我尝试运行我的appium程序而不在移动设备中启用vpn时,它可以正常工作。 但是当我在移动设备中启用VPN服务并执行时,相同的prgram无法启动android驱动程序会话 它也会重新启动adb服务器。
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability(MobileCapabilityType.DEVICE_NAME, DEVICE_SERIAL);
desiredCapabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "UiAutomator2");
desiredCapabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "ANDROID");
desiredCapabilities.setCapability("udid", DEVICE_SERIAL);
desiredCapabilities.setCapability("autoGrantPermissions", "true");
desiredCapabilities.setCapability("appPackage", "com.sonyliv");
desiredCapabilities.setCapability("appActivity", "tv.accedo.via.android.app.splash.InitializationActivity");
AndroidDriver androidDriver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), desiredCapabilities);
Appium服务器日志:
[ADB] Getting connected devices... [debug] [ADB] 0 device(s) connected [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Killing adb server on port 5037 [debug] [ADB] Getting connected devices... –