You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

安装appium-xcuitest-driver遇xcodebuild报错求助

Fix for "xcodebuild requires Xcode but active directory is CommandLineTools" when installing appium-xcuitest-driver

Hey Sara, I’ve dealt with this exact headache when setting up Appium for iOS testing—don’t worry, it’s an easy fix, even if you already have Xcode installed!

The problem here is that your system’s active developer directory is currently pointing to the standalone Command Line Tools, but xcodebuild (which Appium needs for iOS testing) requires the full developer tools bundled with Xcode. Here’s how to switch it over:

  • First, confirm where your Xcode is installed. By default, it’s in /Applications/Xcode.app—if you moved it, adjust the path accordingly. You can also double-check in Xcode itself: open Xcode, go to Xcode > Settings > Locations, and look at the Command Line Tools dropdown (it should show your installed Xcode version).

  • Open Terminal and run this command to switch the active developer directory to Xcode’s tools:

    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
    

    You’ll need to enter your admin password when prompted.

  • Verify the change worked by running:

    xcode-select -p
    

    This should output /Applications/Xcode.app/Contents/Developer (or your custom Xcode path) if everything went right.

  • One quick check: if you just installed Xcode, make sure you’ve opened it at least once and accepted the license agreement. If you skip this, xcodebuild might still throw errors even after switching the directory.

Once you’ve done these steps, try installing appium-xcuitest-driver again—it should pick up the Xcode tools correctly now.

内容的提问来源于stack exchange,提问作者Sara

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 09:00:01