Can Xcode include application resource files that are generated during the build process?

I have a bunch of content files for my iPhone application, which I generate with a shell script. It takes too long to become part of the Xcode build process, so I run it periodically.

I don’t want to constantly add these files to my Xcode project to include them in my application resource folder. Is there a way to get Xcode to copy the contents of the folder to the application resources during build? (It would be a bonus if I could specify other locations, such as the document folder of the relevant documents.)

I tried to add a new β€œcopy build phase” to my target, but that didn't seem to work. This seems like a common problem, but I could not find anything here.

- Change (what I did)

Regarding Jasarien and cdespinosa, I did the following in a build script. I decided not to copy to the destination, because it will only work when using the simulator, I do not think that it will work when deploying to the device.

cp -rf "$PROJECT_DIR/mystuff" "$CONFIGURATION_BUILD_DIR/$CONTENTS_FOLDER_PATH/" 

- Change 2

This is not like getting files on my iPhone. Any ideas?

+1
source share
2 answers

You can configure the startup phase of the Script in the target application. Write Script to copy the resources to the application package.

+2
source

This is the way I use to output:

 ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH} 

Just copy your files to this directory, this is a package (simulator or device).

You can also see my answer here: how to configure an Xcode build rule with a variable list of output files?

0
source

Source: https://habr.com/ru/post/1402813/


All Articles