I wanna run my swift programing on Terminal, so I cd
the root folder of my project, and run $ swift build
, but there is a error occurred.
$ error: root manifest not found
Any help?
In case anyone else stumble upon the same problem, the solution for me was to cd to the Sources folder of my scripts, not the root folder.
I had this error happen to me when I was building a CLI tool on Xcode. First off, when Xcode talks about root manifest
, it means package.swift
. You don't have one in your directory or parent directories. I discovered 2 options:
swift build
, use Xcode's UI or xcodebuild
CLI and get the build files in finder/ terminalProject Navigator
like below:Archive
in Xcode instead and you can get the build files: Project Name 25-03-2021, 11.30.xcarchive/Products/usr/local/bin/executable
in my case the executable is called Image Labeling
Instead of creating the project through Xcode (CLI tool template) use the swift
cli tool instead: swift package init --type executable
. In this case, swift build
works everywhere in the project, not just in Sources
because package.swift
was added to the root of the project.
When you call the
-Swift build
command you must use it from Swift Package Manager and you should have 2 folders in the directory:
Source
Test
you should use the following command for project:
- name: Build
run: |
xcodebuild clean test -project "yourproject.xcproject" -scheme "yourproject" -destination "platform=iOS Simulator,name=iPhone 12 Pro,OS=latest" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO
and you should use the following commands for workspace:
- name: Build
run: |
xcodebuild clean build -workspace "yourproject.xcworkspace" -scheme "yourtarget" -destination "platform=iOS Simulator,name=iPhone 12 Pro,OS=latest" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO
- name: Test
run: |
xcodebuild clean test -workspace "yourproject.xcworkspace" -scheme "yourtargetTests" -destination "platform=iOS Simulator,name=iPhone 12 Pro,OS=latest" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With