This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 6
Sep 2015

I am trying to reference apk from url but not successful. Here is what I am trying -

capabilities.setCapability("app", new URL("http://jenkinsserverurl:8181/job/projectname/apk/apkname.apk"));
.
.
.
driver = new RemoteWebDriver(new URL("http://remote test url:4723/wd/hub"),capabilities);

Appium server throws following error :-

info: --> POST /wd/hub/session {"desiredCapabilities":{"app":{"userInfo":null,"query":null,"hCode":1439549959,"defaultPort":80,"path":"//.apk","protocol":"http","ref":null,"file":"//.apk","port":8181,"authority":":8181","host":"","class":"java.net.URL"},"appPackage":"","appActivity":".MainActivity","browserName":"","platformName":"Android","version":"4.4","deviceName":"emulator-5554","platform":"ANDROID"}}
error: Using local app, but didn't end in .zip, .ipa or .apk

Tried multiple things but no success. Suggestions are welcome.

  • created

    Sep '15
  • last reply

    Jan '19
  • 5

    replies

  • 2.0k

    views

  • 4

    users

  • 1

    like

  • 1

    link

here it is:

FileUtils.copyURLToFile(URL, File) //download file
File appDir = new File(userDir, fileName); //set file
capabilities.setCapability(MobileCapabilityType.APP, appDir.getAbsolutePath());

Thanks @Aleksei !!!

Although I am not sure why appium document says this parameter can be "The absolute local path or remote http URL to an .ipa or .apk file, or a .zip containing one of these".

3 years later

Hi @Aleksei,

FileUtils.copyURLToFile(URL, File) in this line what should I pass as my second parameter