Question

I'm attempting to setup an automated testing environment using appium, however I'm running into trouble. The issue I'm seeing is that appium is extracting the zip containing the .app directory, but then claiming that it can't find the .app. My platform is mac. The exact error is below:

info: Unzipping /var/folders/0s/0kz_6kb13f35wxwjxkff9sdw0000gn/T/appium-app113922-2258-1ap6o7i.zip
info: Testing zip archive: /var/folders/0s/0kz_6kb13f35wxwjxkff9sdw0000gn/T/appium-app113922-2258-1ap6o7i.zip
info: Zip archive tested clean
info: Unzip successful
info: Got configuration error, not starting session
error: Failed to start an Appium session, err was: 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
info: Responding to client with error: {"status":6,"value":{"message":"A session is either terminated or not started","origValue":"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"},"sessionId":null}

I'm not sure if I'm doing something wrong in my code, below is the contents of my setup() method (which is basically copied from the official example).

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("device", "8b0949a1d3fe5d7283cc46ca5470acd67d6c5d7b");
File app = new File("/Users/user/path/to/zip");
capabilities.setCapability("version", "7.0");
capabilities.setCapability("app", app.getAbsolutePath());
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"),
            capabilities);
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
Was it helpful?

Solution 2

For anyone with a similar problem: I fixed this issue by specifying the .app file but specifying the UDID of the device at the command line when running appium instead of in the test code. I think that specifying the 'device' capability causes an error (possibly makes appium think that it's android testing, despite writing out that it's looking for a .app)

OTHER TIPS

Things to consider:

  1. Your .zip should contain only the .app
  2. The .app should be built in XCode with the same dev certificate that is used on the device (iPhone)

For me it worked this way: I built an .app from source in XCode and uploaded to the device. Then in Appium I just specified the Bundle ID (in XCode Window>Organizer>Apps if I remember it right) of the app.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top