Xcodebuild cannot build when there is no physical iOS

xcodebuild guide:

Some activities (for example, construction) can be performed without the actual presence of the device. To create against in the general case, instead of a specific device, the destination specifier may have the prefix optional line "generic /" , which indicates that the platform should be oriented as a whole. An example of a general purpose is the "iOS device" , which is displayed in the Xcode interface when there is no physical iOS device present.

try:

xcodebuild -scheme Test -destination "platform = iOS, name = generic / iOS"
xcodebuild: error: Could not find destination matching arguments in -destination flag:
The requested device could not be found because no available devices matched the request.

+5
source share
4 answers

According to the examples on the xcodebuild man page, the correct way to specify the iOS shared destination:

xcodebuild -destination generic/platform=iOS ... 

(The wording of the description for this is definitely ambiguous or misleading. I would not understand this without an example.)

+10
source

If you get the following error:

 *xcodebuild: error: Failed to build project WatsonCore with scheme WatsonCoreTests. Reason: A build only device cannot be used to run this target.* 

Try this: it works for me in terms of general OS. The hardware device still needs to be specified.

 /usr/bin/xcodebuild -scheme YourScheme -project YourProject -configuration Debug **-destination 'platform=iOS Simulator,name=iPhone 6'** clean build test CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO 
+3
source

I could not get the -desintation flag "platform = generic / ...", but specifying the -sdk flag using the SDK for iPhone OS and not the simulator SDK ( xcodebuild -showsdks shows the available SDKs) allowed me to successfully build without a connected device:

 xcodebuild -project someproject.xcodeproj -scheme somescheme -sdk iphoneos8.0 -configuration Debug 
+1
source

It works when you prefix a specifier assignment with 'generic /'.

 ios.xcode.destination.device=generic/platform=iOS 

Worked for me!

0
source

Source: https://habr.com/ru/post/1201862/


All Articles