XcodeGen generated single-target (iOS16 Xcode14) watchOS app not working

613 Views Asked by At

I found that the newly (iOS16 Xcode 14) introduced single-target watchOS app does not work when I try to implement it with XcodeGen.

I'm getting the following error:

Prepare build
note: Building targets in dependency order
error: Multiple commands produce '/Users/martin/Library/Developer/Xcode/DerivedData/WatchTestGen-eqtccuxbzqoyuncgwdiwyamlfkpb/Build/Products/Debug-watchsimulator/WatchTestWatch Watch App.app/WatchTestWatch Watch App'
    note: Target 'WatchTestWatch Watch App' (project 'WatchTestGen'): CopyAndPreserveArchs /Users/martin/Library/Developer/Xcode/DerivedData/WatchTestGen-eqtccuxbzqoyuncgwdiwyamlfkpb/Build/Products/Debug-watchsimulator/WatchTestWatch Watch App.app/WatchTestWatch Watch App
    note: Target 'WatchTestWatch Watch App' (project 'WatchTestGen') has a command with output '/Users/martin/Library/Developer/Xcode/DerivedData/WatchTestGen-eqtccuxbzqoyuncgwdiwyamlfkpb/Build/Products/Debug-watchsimulator/WatchTestWatch Watch App.app/WatchTestWatch Watch App'


Multiple commands produce '/Users/martin/Library/Developer/Xcode/DerivedData/WatchTestGen-eqtccuxbzqoyuncgwdiwyamlfkpb/Build/Products/Debug-watchsimulator/WatchTestWatch Watch App.app/WatchTestWatch Watch App'

Build failed    2022-08-30 16:41    1.2 seconds

I created a sample project with the failing project.yml here: https://github.com/MartinP7r/xcodegen-watch-sample

WatchTest.xcodeproj works fine while the generated WatchTestGen.xcodeproj does not.

This requires Xcode 14 beta.

I'd be very happy about any advice on where to look for errors in my project or otherwise.

1

There are 1 best solutions below

1
On

I was able to get this working. It seems like the target type should simply be application, not application.watchapp2 .

type: application
platform: watchOS