# Xcode schemes for package projects

**URL:** <https://forums.swift.org/t/xcode-schemes-for-package-projects/40156>\
**Category:** Using Swift\
**Created:** [September 10, 2020, 12:21am UTC](https://forums.swift.org/t/xcode-schemes-for-package-projects/40156 "2020-09-10T00:21:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JetForMe](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jetforme/32/482_2.png) [@JetForMe](https://forums.swift.org/u/JetForMe)\
**Post date:** [September 10, 2020, 12:21am UTC](https://forums.swift.org/t/xcode-schemes-for-package-projects/40156/1 "2020-09-10T00:21:11Z")

</div>

I've been working on a Vapor project for a while (using Xcode, but it's an SPM project), but after recently adding a dependency and then invoking Xcode’s "Update to Latest Package Versions" command, all of my schemes are broken. This has happened before, but I'm not sure how I resolved it (I think I closed and reopened the project, which didn't work this time).

There are four schemes for some reason. I have two targets in `Package.swift`. The Run Destination for my schemes is either "no device" or "My Mac," but these change every time I try to Run or Build. In all cases, Run and Build are disabled.

Inspecting some of the schemes, I see "Expand Variables Based on" with a popup of other schemes next to it. All of those are listed as "(missing)."

I really don't know what's going on, but it's extremely frustrating. Any ideas how to clean this up and make it reliable?

---

<div class="post-metadata">

**Author:** ![0xTim](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/0xtim/32/27968_2.png) [@0xTim](https://forums.swift.org/u/0xTim)\
**Post date:** [September 10, 2020, 10:27am UTC](https://forums.swift.org/t/xcode-schemes-for-package-projects/40156/2 "2020-09-10T10:27:57Z")

</div>

Broken schemes with XPM usually means that dependency resolution failed. Is there an error in the report navigator or does `swift package resolve` show anything?

To fix other issues, you can do a clean, remove the `.swiftpm` directory and/or delete derived data. Or even delete **Package.resolved** if the resolved file is corrupted. One of those should fix it

---

<div class="post-metadata">

**Author:** ![JetForMe](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jetforme/32/482_2.png) [@JetForMe](https://forums.swift.org/u/JetForMe)\
**Post date:** [September 10, 2020, 10:24pm UTC](https://forums.swift.org/t/xcode-schemes-for-package-projects/40156/3 "2020-09-10T22:24:11Z")

</div>

Alas, I dealt with it by deleting `.swiftpm` and letting Xcode rebuild everything. Which kinda sucked because I had to remember the scheme customizations I had done like setting the PWD (I think the `PROJECT_DIR` is a better default PWD).
