Xamarin.UITest DeviceAgentException:无法安装 DeviceAgent

Xamarin.UITest DeviceAgentException: Failed to install DeviceAgent

如何解决在 iOS 设备上 运行 Xamarin.UITest 时发生的错误?

它发生在 iOS 模拟器和物理 iOS 设备上。

SetUp : Calabash.XDB.Core.Exceptions.DeviceAgentException : Failed to install DeviceAgent: ApplicationName='/var/folders/5m/3712cp7j2k928k6z3fgszfyw0000gp/T/xdb/DeviceAgent.iOS.Dependencies/93c12f73043a2d14eea9d417ab080eb4/bin/iOSDeviceManager', CommandLine='install -d fcbb5006c892e39f1f675a3f6804ce3688c3b8d1 -a /var/folders/5m/3712cp7j2k928k6z3fgszfyw0000gp/T/xdb/DeviceAgent.iOS.Dependencies/93c12f73043a2d14eea9d417ab080eb4/ipa/DeviceAgent-Runner.app', CurrentDirectory='', Native error= Cannot find the specified file

----> System.ComponentModel.Win32Exception : ApplicationName='/var/folders/5m/3712cp7j2k928k6z3fgszfyw0000gp/T/xdb/DeviceAgent.iOS.Dependencies/93c12f73043a2d14eea9d417ab080eb4/bin/iOSDeviceManager', CommandLine='install -d fcbb5006c892e39f1f675a3f6804ce3688c3b8d1 -a /var/folders/5m/3712cp7j2k928k6z3fgszfyw0000gp/T/xdb/DeviceAgent.iOS.Dependencies/93c12f73043a2d14eea9d417ab080eb4/ipa/DeviceAgent-Runner.app', CurrentDirectory='', Native error= Cannot find the specified file

我以前也遇到过这个问题,它是由该文件夹中的损坏文件引起的。导航到该目录: '/var/folders/5m/3712cp7j2k928k6z3fgszfyw0000gp/T/' 并删除文件夹 'xdb'。这应该可以解决问题。

仅供参考:UITest 团队已意识到这一点,他们在 2.0.1 版中进行了修复。