7

A shell script to selectively copy your GoogleService-Info.plist into your app b...

 2 years ago
source link: https://gist.github.com/tylermilner/f8e9121d62c890cb707bc1810a7d57d9
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
A shell script to selectively copy your GoogleService-Info.plist into your app bundle based on the current build configuration.

Updated the final step in the script (copying the appropriate GoogleService-Info.plist) to support paths with spaces. Thanks to @t0rn for pointing out the issue and providing a fix with his fork.

reneeOlson commented on Aug 16, 2018

edited

Hi Tyler. I really appreciate your solution because I did not want to add another target. However, I’ve had a couple things occur since I implemented it yesterday. The first thing was that xcode asked me to add a new URL scheme for the production version, which I did and things seemed to ran ok yesterday. But today, I keep getting a message — No default storage bucket found - on the debug version. I’ve had this app/firebase debug project working fine regarding storage until today. I’ve never used a shell script before, so not sure if it’s the reason for this error. What are your thoughts? Appreciate your help! FYI - I also posted this on the Medium website before here.

Hi Tyler. I ended up figuring it out, so never mind. Thanks again for your script and tutorial on Medium.

NoaD commented on Jan 18, 2021

This script and the article in Medium are great.
I had to change the script to handle mac app as well - the target location is different, so I added the following

if [ "${SWIFT_PLATFORM_TARGET_PREFIX}" == "macos" ]
then
    PLIST_DESTINATION=${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Resources
else
    PLIST_DESTINATION=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app
fi

Hi I am having an issue when i integrated this script and used the approach you suggested into my existing project . The issue is as follows
error: Could not get GOOGLE_APP_ID in Google Services file from build environment

When targeting watchos use:
PLIST_DESTINATION=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.appex

NTA-trongpq commented 5 days ago

edited

Hi @tylermilner . This is save my day. Can you explain why set PLIST_DESTINATION=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app and not the other? Where is ${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app location in my project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK