Wednesday, December 17, 2025
HomeiOS DevelopmentCustomized working listing in Xcode

Customized working listing in Xcode


Learn to set a customized working listing in Xcode to resolve some of the widespread newbie challenge when utilizing Vapor.

What’s a customized working listing?

Once you attempt to construct and run your Vapor utility utilizing Xcode you may face the problem that there are some lacking recordsdata, sources or Leaf templates. Don’t fear this can be a quite common rookie mistake, however what causes this downside precisely? 🤔

Vapor is utilizing a spot referred to as working listing to set the present setting, find widespread sources and publicly out there recordsdata. This working listing often incorporates a Sources folder the place you may put your Leaf templates and a Public folder which is utilized by the FileMiddleware. The server can also be making an attempt to seek for potential dotenv recordsdata to configure environmental variables.

For those who run your backend utility with out explicitly setting a customized working listing, you must see a warning message in Xcode’s console. In case you are utilizing Feather CMS, the app will crash and not using a customized working listing set, as a result of it’s required to offer a working setting. 🙃

Customized working listing in Xcode

For those who don’t specify this practice work dir, Xcode will attempt to search for the sources below a random, however uniquely created place someplace below the DerivedData listing.

That is the interior construct folder for the IDE, it often creates a lot of different “rubbish” recordsdata into the ~/Library/Developer/Xcode/DerivedData listing. In 99% of the instances you may safely delete its contents if you wish to carry out a 100% clear construct. 👍

The way to set a customized working listing?

To start with, open your mission in Xcode by double clicking the Bundle.swift manifest file.

Do NOT use the swift bundle generate-xcodeproj command to generate a mission file!!! This can be a deprecated Swift Bundle Supervisor command, and it’s going to be eliminated quickly.

✅ I repeat: at all times open SPM tasks by means of the Bundle.swift file.

Target

Wait till the IDE masses the required Swift packages. After the dependencies are loaded, click on on the goal subsequent to the cease button. The executable goal is marked with just a little terminal-like icon. 💡

Edit scheme

Choose the “Edit Scheme…” choice from the out there menu gadgets, this could open a brand new modal window on high of Xcode.

Custom working directory

Make it possible for the Run configuration is chosen on the left aspect of the pane. Click on on the “Choices” tab, after which search for the “Working listing” settings. Test the “Use customized working listing:” toggle, this can allow the enter area beneath, then lastly click on on the little folder icon on the highest proper aspect (of the enter area) and search for your required listing utilizing the interface. 🔍

Press the “Select” button if you find yourself prepared. It is best to see the trail of your alternative written contained in the textual content area. Just remember to’ve chosen the appropriate location. Now you may click on the “Shut” button on the underside proper nook, then you may attempt to begin your server by clicking the run button (play icon or you may press the CMD+R shortcut to run the app). ▶️

For those who did the whole lot proper, your Vapor server utility ought to use the customized working listing, you may affirm this by checking the logs in Xcode. The beforehand talked about warning ought to disappear and your backend ought to be capable to load all the mandatory sources with out additional points. I hope this little information will aid you to keep away from this widespread mistake when utilizing Vapor. 🙏

RELATED ARTICLES

Most Popular

Recent Comments