xcodebuild Apple Watch - iOS 16.1/wachOS 9.1 - fails

Hi guys,

Recently I updated my devices to the newest version and with this update I am having troubles to run xcodebuild commands when destination is my Apple Watch. Have anyone experienced such problems? let me know

Answered by zhanch in 735677022

UPD Everything works fine when we use -target option for xcododebuild command line arguments instead of -scheme, but could not use option due to project -target.

The problem is in the scheme configuration or devices visibility for scheme, or both Also, it is working when I use generic destination:

xcodebuild -project MyApp.xcodeproj -scheme 'MyApp WatchKit App' -destination generic/platform=watchOS build

command I used: xcodebuild -workspace MyApp.xcworkspace -scheme 'MyApp WatchKit App' -destination 'platform=watchOS,id=Watch's ID' And I see this error:

	(null) needs to connect to determine its availability. Check the connection between the device and its companion iPhone, and the connection between the iPhone and Xcode. Both devices may also need to be restarted and unlocked.```

P.S. Restarting and unlocking doesn't help


Accepted Answer

UPD Everything works fine when we use -target option for xcododebuild command line arguments instead of -scheme, but could not use option due to project -target.

The problem is in the scheme configuration or devices visibility for scheme, or both Also, it is working when I use generic destination:

xcodebuild -project MyApp.xcodeproj -scheme 'MyApp WatchKit App' -destination generic/platform=watchOS build

command I used: xcodebuild -workspace MyApp.xcworkspace -scheme 'MyApp WatchKit App' -destination 'platform=watchOS,id=Watch's ID' And I see this error:

	(null) needs to connect to determine its availability. Check the connection between the device and its companion iPhone, and the connection between the iPhone and Xcode. Both devices may also need to be restarted and unlocked.```

P.S. Restarting and unlocking doesn't help


xcodebuild Apple Watch - iOS 16.1/wachOS 9.1 - fails
 
 
Q