-1

下面的代码用于在 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);
}
  }
4

1 回答 1

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 服务器文档以了解功能

于 2017-11-10T21:37:09.957 回答