View in #support on Slack
@Tyler_Kuntz: Hello, I can’t figure out how to add development assets to a target, is this possible?
@Dosu: To add development assets to a target without including them in the build phase, you can use the additionalFiles
attribute in Tuist. This allows you to keep assets in the project structure without adding them to the Copy Bundle Resources
build phase. Here’s an example:
Target(
name: "Sample",
destinations: [.iPhone],
product: .app,
productName: "SampleApp",
bundleId: "<http://com.sample.app|com.sample.app>",
sources: ["Sources/**"],
resources: ["Resources/**"],
additionalFiles: [
"Resources/Assets.xcassets"
]
)
This configuration keeps Assets.xcassets
in the generated Xcode project but omits it from the build phase, allowing you to manage assets without duplicating them in the build output [1].
@Tyler_Kuntz: Okay great. It does not get added to the Xcode UI under “Development Assets”, but tuist build
will not include these additional files?
@Marek_Fořt: Hey!
Development assets are a bit different from additional files.
Additional files are included in the generated project, but they are not embedded as resources, neither in debug nor in production.
Development assets are available when running the app via Xcode but they get stripped when archiving it.
In other words, to add a development asset, add a regular resource and then specify the paths that you want to be stripped from the app during archive using the DEVELOPMENT_ASSET_PATHS build setting.
Apple Developer Documentation: Build settings reference | Apple Developer Documentation