错误:未发现迦太基。使用`brew install carthage`安装

时间:2017-10-16 06:49:53

标签: java appium-ios carthage

我正在尝试使用Appium和使用Eclipse IDE进行UIAutomation,每当我尝试通过testng.xml文件运行代码时,它都无法在Phone / Simulator上安装WebDriverAgent。如果我在不使用XML文件的情况下运行相同的代码,它可以正常运行。这是日志:

Error: Carthage not found. Install using `brew install carthage.`
    at Object.wrappedLogger.errorAndThrow (../../lib/logging.js:63:13)
    at checkForDependencies$ (../../../lib/wda/utils.js:59: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:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[debug] [BaseDriver] Event 'wdaStartFailed' logged at 1508135361248 (11:59:21 GMT+0530 (IST))
[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 1508135372395 (11:59:32 GMT+0530 (IST))
[XCUITest] Launching WebDriverAgent on the device

3 个答案:

答案 0 :(得分:0)

我通过执行以下步骤解决了问题:

1) Right click on your project > Run as > Run Configurations
2) Select Environment tab
3) Click on select option and select PATH environment
4) Edit Path variable using Edit option
5) Update path value with carthage location /usr/local/bin and select append env to native env
6) Apply changes and run the test.

答案 1 :(得分:0)

将环境路径更新为“ / usr / local / bin:/ usr / bin:/ bin:/ usr / sbin:/ sbin”

SET PATH

答案 2 :(得分:0)

确保function Comp1() { const [user, setUser] = useState({}); firebase.auth().onAuthStateChanged(function (_user) { if (_user) { // User is signed in. setUser(_user); } else { setUser({ exists: false }); } }); return ( <div> <UserProvider.Provider value={{user, setUser}}> <Comp2 /> <Comp3 /> </UserProvider.Provider> </div> ); } function Comp2(props) { const { user, setUser } = useContext(UserProvider); return ( <div> {user.exists} </div> ) } function Comp3(props) { const { user, setUser } = useContext(UserProvider); return ( <div> {user.exists} </div> ) } //User Provider import React from 'react'; const UserProvider = React.createContext(); export default UserProvider; 正在使用您登录的当前用户运行:

在终端机中:

Appium

输出应类似于:

lsof -n -i:4723 | grep LISTEN

我做错了什么:我向node 488 your-user-here 21u IPv4 0xf2aca68f2aca68ff 0t0 TCP *:4723 (LISTEN) 添加了一个启动配置,以通过系统启动自动启动Appium,但这产生了错误:“找不到迦太基”,因为该过程是/Library/LaunchAgents,而不是我的特定用户(安装了brew的root

因此,请谨慎设置Appium的启动脚本。与carthage用户一起运行时,找不到与特定用户对应的PATH。