Ariel Weinberger
Ariel Weinberger

Reputation: 2301

How to copy custom files to iOS build with Capacitor

I am using Firebase with Capacitor. This requires me to have a file named GoogleService-Info.plist at the root folder of my XCode project. I have that file.

After building and syncing the project with Capacitor, I need to find a way to copy that file to the XCode project.

Simply copying the file using a bash script won't work, as it is then needed to manually add it from the XCode user interface.

I would like to automate this, so that we don't have to manually do that every time we build.

Upvotes: 1

Views: 761

Answers (1)

jcesarmobile
jcesarmobile

Reputation: 53341

In capacitor apps you are supposed to commit the ios folder so you only need to manually copy it once, then commit the change so you don’t have to repeat.

But if you want to copy files using node scripts you can use Cordova-node-xcode library, despite the name, it’s not cordova specific https://github.com/apache/cordova-node-xcode

It has an addResourceFile function that you can use for plist files

Upvotes: 1

Related Questions