我用SauceLabs example如何正確添加應用程序文件到appium Desired Capabilities?
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("BROWSER_NAME", "Android");
capabilities.setCapability("VERSION", "4.4.2");
capabilities.setCapability("deviceName", "Android Emulator");
capabilities.setCapability("platformName", "Android");
//zip file containing your app to be tested
capabilities.setCapability("app", "http://appium.s3.amazonaws.com/TestApp6.0.app.zip");
driver = new RemoteWebDriver
(new URL(MessageFormat.format("http://{0}:{1}@ondemand.saucelabs.com:80/wd/hub",
sauceUserName, sauceAccessKey)), capabilities);
這是完全正常工作。 但是當我下載的壓縮與應用程序和切換到當地的環境
capabilities.setCapability("app", app.getAbsolutePath());
driver = new RemoteWebDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
我從appium控制檯遇到錯誤:
error: Failed to start an Appium session, err was: Error: Bad app: /home/.../appium/assets/TestApp6.0.app.zip. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: App zip unzipped OK, but we couldn't find a .app bundle in it. Make sure your archive contains the .app package and nothing else
請您顯示,其中可變的應用(從app.getAbsolutePath())被定義的代碼? – Eugene
**請解壓縮.app文件,並提供完全限定的.app文件路徑到應用程序路徑功能。** – Rohith