以下代码用于在appium中启动应用程序,但我无法使用wifi远程启动应用程序。但是,当我检查adb设备时,它已连接到手机。运行脚本后,它无法在adb中连接设备。它将终止服务器
public class TestLauncher
{
public static void main(String[] args) throws MalformedURLException
{
AppiumDriver driver;
DesiredCapabilities capabilities=new DesiredCapabilities();
capabilities.setCapability("noReset","true");
capabilities.setCapability("fullReset","false");
capabilities.setCapability("udid","192.168.1.163:5555");
capabilities.setCapability("deviceName","SWIPE ELITE");
capabilities.setCapability("platformName","Android");
capabilities.setCapability("platformVersion","5.0.2");
capabilities.setCapability("browserName","");
File file = new File("/home/nishant/APK/SoftController","com.x18thparallel.softcontroller-msg_support_wo_ime_change-vA.3.219.apk");
capabilities.setCapability("app",file.getAbsolutePath());
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
}
}
答案 0 :(得分:0)
没有appium服务器日志没什么可说的,但让我们从简单开始:使用适用于Android的正确功能:
DesiredCapabilities capabilities= new DesiredCapabilities();
capabilities.setCapability("platformName","Android");
capabilities.setCapability("deviceName","SWIPE ELITE");
capabilities.setCapability("appWaitPackage","your_app_package_name");
capabilities.setCapability("appWaitActivity","activity_name_to_wait");
File file = new File("/home/nishant/APK/SoftController",
"com.x18thparallel.softcontroller-msg_support_wo_ime_changevA.3.219.apk");
capabilities.setCapability("app",file.getAbsolutePath());
检查官方appium服务器documentation以了解功能