我使用Visual Studio Team Services构建我的应用。当我尝试运行单元测试时,我收到错误:
xcodebuild: error: option 'Destination' requires at least one parameter of the form 'key=value'
升级到Xcode 8.3后开始。构建服务器有8.3,但是当我运行单元测试时,它想要使用8.2模拟器。这失败了。
当我尝试使用-destination
开关明确指定8.3模拟器时,它会失败。
-destination "platform=iOS Simulator,name=iPad Pro (9.7 inch),OS=10.3"
我也试过使用撇号'在目的地附近,没有引号或撇号,以及模拟器ID,但没有任何帮助。没有引号,我收到此错误:
xcodebuild: error: Unknown build action 'Pro'.
答案 0 :(得分:4)
尝试使用双引号而不是单引号,如下所示:
-destination "platform=iOS Simulator,name=iPad Pro (9.7 inch),OS=10.3"
这为我解决了同样的问题。
答案 1 :(得分:3)
我的错!我试图将-destination
参数放在Actions框中,如下所示:
我没有看到Advanced下的Arguments框。 当我把这个参数放在那里时,它可以工作!
奇怪的是它接受并试图在Actions框中使用-destination参数。
似乎不允许这样做,或者如果允许的话,处理的方式与在Arguments框中的处理方式相同。
感谢GitHub上的madhurig为她reply提出了我的问题,这让我误解了。
答案 2 :(得分:1)
单引号以'key=value'
的形式工作,如下:
-destination 'platform=iOS Simulator,OS=12.1,name=iPhone X'
要获取已知设备的列表,请使用:
instruments -s devices
答案 3 :(得分:0)
登陆这里寻找同样错误的解决方案。与附录一样,您也可以将单个key = val传递给-destination,例如-destination 'platform=iOS'
,xcodebuild将告诉您该方案可用的所有替代方案。
λ ~/Development/app-ios/ task/JIOS-400-Earl-Grey-Spike* xcodebuild -workspace app.xcworkspace -scheme app -destination 'platform=iOS' -derivedDataPath "build" build-for-testing
User defaults from command line:
IDEDerivedDataPathOverride = /Users/schoudhary/Development/app-ios/build
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ platform:iOS }
Missing required device specifier option.
The device type “Generic iOS Device” requires that either “name” or “id” be specified.
Please supply either “name” or “id”.
Available destinations for the "App" scheme:
{ platform:iOS Simulator, id:D248DB01-A852-4360-A9C0-2D71AFE478D7, OS:10.3, name:iPad Air }
{ platform:iOS Simulator, id:CE87AF5A-141C-43DA-AE61-AF53593F37F7, OS:10.3, name:iPad Air 2 }
{ platform:iOS Simulator, id:E93B43E4-D24E-4927-B9EE-0375E15DCBD5, OS:10.3, name:iPad Pro (9.7 inch) }
{ platform:iOS Simulator, id:6D71DB17-0FE2-4D5E-BEE6-CC696445BA11, OS:10.3, name:iPad Pro (12.9 inch) }
{ platform:iOS Simulator, id:F7E37EF4-5E72-438A-A286-216C20158B47, OS:10.3, name:iPhone 5 }
{ platform:iOS Simulator, id:24653844-AE99-4B5B-8332-9FFD2208172F, OS:10.3, name:iPhone 5s }
{ platform:iOS Simulator, id:FD2089A4-BF3F-4F98-8E33-B7EFDCFE5B4D, OS:10.3, name:iPhone 6 }
{ platform:iOS Simulator, id:6EF0DFBD-E99E-4EB3-9C51-6E749F41B6E7, OS:10.3, name:iPhone 6 Plus }
{ platform:iOS Simulator, id:846E631C-6285-4B91-9BA6-1AB6E66C88DB, OS:10.3, name:iPhone 6s }
{ platform:iOS Simulator, id:A6943ADC-F6EF-42F6-9958-D966DFC419FC, OS:10.3, name:iPhone 6s Plus }
{ platform:iOS Simulator, id:B41ABED0-7554-438A-97AC-F34943ED4D79, OS:10.3, name:iPhone 7 }
{ platform:iOS Simulator, id:20F1582C-0D19-4F42-9DAD-43138FB923B9, OS:10.3, name:iPhone 7 Plus }
{ platform:iOS Simulator, id:683BB5CA-E0A8-4CE4-B0DD-AED4C4295B90, OS:10.3, name:iPhone SE }
Ineligible destinations for the "App" scheme:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Generic iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Generic iOS Simulator Device }
另一种获得正确目的地的有用方法。