question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Appium 1.7.0]Error: Carthage not found. Install using `brew install carthage` when use AppiumDriverLocalService start Appium Server

See original GitHub issue

The problem

Use AppiumDriverLocalService Get “Error: Carthage not found. Install using brew install carthage” error In fact, carthage already installed Warning: carthage 0.25.0 is already installed

Environment

  • Appium version :V1.7.0
  • Last Appium version that did not exhibit the issue (if applicable):1.7.0
  • Desktop OS/version used to run Appium:Mac OS 10.12.6
  • Node.js version (unless using Appium.app|exe):v8.2.1
  • Mobile platform/version under test:iOS11
  • Real device or emulator/simulator:Simulator
  • Appium CLI or Appium.app|exe:Appium CLI(AppiumDriverLocalService, only AppiumDriverLocalService)

Details

If necessary, describe the problem you have been experiencing in more detail.

Link to Appium logs

[XCUITest] Launching WebDriverAgent on the device [XCUITest] Error: Carthage not found. Install using brew install carthage at Object.wrappedLogger.errorAndThrow (…/…/lib/logging.js:63:13) at checkForDependencies$ (…/…/…/lib/wda/utils.js:58:9) at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js💯21) at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) at <anonymous> Error: Carthage not found. Install using brew install carthage at Object.wrappedLogger.errorAndThrow (…/…/lib/logging.js:63:13) at checkForDependencies$ (…/…/…/lib/wda/utils.js:58:9) at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js💯21) at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) at <anonymous> [debug] [BaseDriver] Event ‘wdaStartFailed’ logged at 1506353306468 (23:28:26 GMT+0800 (CST)) [debug] [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: “Carthage not found. Install using brew install carthage”. [debug] [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying [XCUITest] Shutting down sub-processes [debug] [XCUITest] Removing WDA application from device [debug] [BaseDriver] Event ‘wdaStartAttempted’ logged at 1506353317625 (23:28:37 GMT+0800 (CST)) [XCUITest] Launching WebDriverAgent on the device [XCUITest] Error: Carthage not found. Install using brew install carthage at Object.wrappedLogger.errorAndThrow (…/…/lib/logging.js:63:13) at checkForDependencies$ (…/…/…/lib/wda/utils.js:58:9) at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js💯21) at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) at <anonymous> Error: Carthage not found. Install using brew install carthage at Object.wrappedLogger.errorAndThrow (…/…/lib/logging.js:63:13) at checkForDependencies$ (…/…/…/lib/wda/utils.js:58:9) at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js💯21) at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) at <anonymous> [debug] [BaseDriver] Event ‘wdaStartFailed’ logged at 1506353317628 (23:28:37 GMT+0800 (CST)) [debug] [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: “Carthage not found. Install using brew install carthage”. [debug] [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying [XCUITest] Shutting down sub-processes [debug] [XCUITest] Removing WDA application from device [XCUITest] Error: Unable to launch WebDriverAgent because of xcodebuild failure: “Carthage not found. Install using brew install carthage”. at XCUITestDriver.quitAndUninstall$ (…/…/lib/driver.js:381:13) at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js💯21) at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) Error: Unable to launch WebDriverAgent because of xcodebuild failure: “Carthage not found. Install using brew install carthage”. at XCUITestDriver.quitAndUninstall$ (…/…/lib/driver.js:381:13) at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js💯21) at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) [debug] [XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on. [debug] [iOSLog] Stopping iOS log capture [MJSONWP] Encountered internal error running command: Error: Unable to launch WebDriverAgent because of xcodebuild failure: “Carthage not found. Install using brew install carthage”. at XCUITestDriver.quitAndUninstall$ (…/…/lib/driver.js:381:13) at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js💯21) at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) [HTTP] <-- POST /wd/hub/session 500 26591 ms - 262 Create a GIST which is a paste of your full Appium logs, and link them here. Do NOT paste your full Appium logs here, as it will make this issue very long and hard to read! If you are reporting a bug, always include Appium logs!

Code To Reproduce Issue [ Good To Have ]

Please remember that with sample code it’s easier to reproduce the bug and it’s much faster to fix it.

Please git clone https://github.com/appium/sample-code and use one of your favourite languages and sample apps to reproduce the issue.

In case a similar scenario is missing in sample-code, please submit a PR with one of the sample apps provided.

import io.appium.java_client.MobileElement; import io.appium.java_client.ios.IOSDriver; import io.appium.java_client.remote.MobileCapabilityType; import main.java.com.dbyl.appiumServer.AppiumServerUtils;

import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.remote.DesiredCapabilities; import org.testng.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test;

import java.net.MalformedURLException; import java.net.URL; import java.util.concurrent.TimeUnit;

public class iOSBrowser { IOSDriver<MobileElement> driver; public URL url; DesiredCapabilities capabilities = new DesiredCapabilities();

@BeforeClass(alwaysRun = true)
public void startAppiumServer() {
	capabilities.setCapability("platformName", "iOS");
	//只需要在这里使用data provider控制一下版本,传入不同的版本号
	capabilities.setCapability("platformVersion", "11.0");
	AppiumServerUtils.getInstance().stopServer();
	url = AppiumServerUtils.getInstance().startServer("127.0.0.1", 4723, capabilities);

}

@BeforeMethod
public void setUpDriver() throws MalformedURLException {

	capabilities.setCapability("browserName", "safari");
	if (capabilities.getCapability("platformVersion").toString().contains("11")) {
		capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");
		capabilities.setCapability("platformVersion", "11.0");
		capabilities.setCapability("deviceName", "iPhone SE");
	} else {
		capabilities.setCapability("platformVersion", "8.4");
		capabilities.setCapability("deviceName", "iPhone 5s");
	}

	driver = new IOSDriver<MobileElement>(url, capabilities);

}

@Test
public void iOSTest() {

	driver.get("http://www.baidu.com");
	driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
	JavascriptExecutor jse = (JavascriptExecutor) driver;
	String status = (String) jse.executeScript("var status=document.readyState;return status");
	Assert.assertTrue(status.contains("complete"));
	System.out.println(driver.getTitle());
	jse = (JavascriptExecutor) driver;
	jse.executeScript("document.getElementById('index-kw').value='appium'");
	driver.findElement(By.xpath("//button[@id='index-bn']")).click();
	System.out.println(driver.getTitle());
	Assert.assertTrue(driver.getTitle().contains("appium"));
}

@AfterClass
public void afterTest() {
	driver.quit();
}

}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11

github_iconTop GitHub Comments

7reactions
tareqalomourcommented, Dec 25, 2017

I fixed this by doing the following steps:

1- Right click on your project > Run as > Run Configuration 2- Select Environment 3- Update your project PATH to be like this: /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin @tobecrazy @garlapati99

2reactions
VenkiDevelopercommented, Jun 11, 2018

I fixed issue by doing the following steps:

  • Right click on your project > Run as > Run Configurations
  • Select Environment tab
  • Click on select option and select PATH environment
  • Edit Path variable using Edit option
  • Update path value with carthage location /usr/local/bin and select append env to native env
  • Apply changes and run the test.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Carthage not found when I starts the appium server ...
Install using brew install carthage if it is not installed and make sure the root folder, where carthage binary is installed, is present...
Read more >
Error: Carthage not found. Install using `brew install carthage`
I fixed issue by doing the following steps: 1) Right click on your project > Run as > Run Configurations 2) Select Environment...
Read more >
Appium installation and configuration under macOS - Medium
Using the software installed by brew, the sudo command is no longer needed. Open terminal, copy and run: /usr/bin/ruby -e "$(curl -fsSL https ......
Read more >
appium_ispair.txt - GitHub
To be able to run appium test on real iPhone, we need to sign app with ... i run the following command "sodu...
Read more >
Appium error [resolved] - Unable to launch WebDriverAgent ...
... carthage. Note – if brew command not found, then install brew for mac ... Note – Run commands from this appium-webdriveragent directory....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found