# Swift cmd strange behaivor

**URL:** <https://forums.swift.org/t/swift-cmd-strange-behaivor/64847>\
**Category:** Using Swift\
**Created:** [May 5, 2023, 9:13pm UTC](https://forums.swift.org/t/swift-cmd-strange-behaivor/64847 "2023-05-05T21:13:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![loginmen](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/loginmen/32/18707_2.png) [@loginmen](https://forums.swift.org/u/loginmen)\
**Post date:** [May 5, 2023, 9:13pm UTC](https://forums.swift.org/t/swift-cmd-strange-behaivor/64847/1 "2023-05-05T21:13:45Z")

</div>

macOS 10.15 (latest update, my macbook latest possible os)

```swift
swift --version
Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
Target: x86_64-apple-darwin19.6.0

```

create package with `swift package init --type executable`  
remove tests folder and target in package file  
`swift run` works fine  
replace main.swift file to app.swift and use `@main` with struct  
then `swift run` give an error `error: no executable product available`, but executable from `swift build` creating in .build/debug/app and run ok  
what's happened? this version of swift should work with `@main`  
if I try to build a multi-file project, it doesn't even create an executable, only .o files  
with the main.swift file, both projects work without problems  
I haven't tried xcode and don't want to use it yet (but installed full latest version for my os)
