1

I have installed Appium and XCode and am trying to launch an app on the simulator. The app works when I open the simulator manually and click on the app.

My capabilities look as follows:

    File app = new File ("/Users/me/Desktop/myapp.app");
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("platformName", "iOS");
    capabilities.setCapability("deviceName", "iPhone 8");
    capabilities.setCapability("automationName", "XCUITest");
    capabilities.setCapability("app", app.getAbsolutePath());
    driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);

The error I get is:

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: "Command 'Scripts/bootstrap.sh -d' exited with code 1". (WARNING: The server did not provide any stacktrace information)

I followed the instructions given in the answer to this question:

Unable to launch ipa file in IOS 10 real Device using appium 1.6.0

When I build the WebDriverAgent through XCode, it builds without any problems, but as soon as I try to launch through IntelliJ or Appium Desktop, it gives me that error.

ChrisG29
  • 1,501
  • 3
  • 25
  • 45

1 Answers1

1

So I eventually managed to get it working, here are some of the errors that I encountered and how I fixed them:

  1. Unable to launch WebDriverAgent because of xcodebuild failure: "Command 'Scripts/bootstrap.sh -d' exited with code 1

Solution: looking at the Appium server log, I noticed that it was unable to write to a directory. The problem was that my Appium app was sitting in Downloads. Once I moved it to Applications, this problem was fixed.

  1. XCode build failed with exit code 65

Solution: the problem here was with my Provisioning Profiles (I opened the app in XCode and went to the General tab to see these). I had created a personal apple account, but I didn't have the certificates needed to run the app. I had to get one of our iOS developers to invite me to their team, downloaded certificates and then ticked the "Automatically manage signing" check box -- there were a couple of other steps with the certificates that I can't remember.

  1. It was connecting to the simulator, it launched WebDriverManager, but then wouldn't launch my app (it just hung).

Solution: I had made a mistake in my capabilities, I had it set as:

capabilities.setCapability("bundleId", "com.facebook.WebDriverAgentLib");

Which was the bundleID for WebDriverAgent, I updated it with the bundleID for my app:

capabilities.setCapability("bundleId", "myapp");

(Bundle ID can be found by going to the app in finder, right clicking and selecting "Show Package Contents". Open the "Info.plist" file and there you'll find the Bundle ID for the app.

ChrisG29
  • 1,501
  • 3
  • 25
  • 45