Say I'm building an app in Salesforce with many different fields, objects, classes, etc.

How do you add those entries to a package.xml file without having to add them one by one as you go? I'm interested in understanding how others create and manage huge package.xml files.

Any help would be appreciated.


So the workflow I'd be following would be:

  • Developing in a sandbox
  • Don't want to use Change Sets
  • High Volume of metadata items
  • Need scripted deployment (thus the need to add items to package.xml)
  • It really depends on your IDE. This is marginally an opinion-based question. Can you give us more info about your workflow? Nov 1, 2018 at 15:38
  • @SebastianKessel I edited the question. Nov 1, 2018 at 16:12

2 Answers 2


If you use DX, you don't need a package.xml; all changes are tracked automatically. Otherwise, the only solution is to modify xml files. You can create an unmanaged package to help facilitate this, but it's still mostly manual. If possible, use DX to simplify your development cycle.

  • Not quite the "only" solution... see my answer. :) But I agree that DX is the way to go. Nov 1, 2018 at 16:45

There is an alternative way to handle your own package.xml. There is a tool called package-xml (link here). You can install it via npm either on your own local or via script in your CI environment (this is what we do).

Run it, and its output is a package.xml file that is ready to deploy. The tool is open source and it is not maintained by me, though I've contributed to it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .