This seems like something which should be pretty easy to do, but for whatever reason, I'm being defeated.
I'm trying to use the firebase-tools CLI to interact with my database. I'm able to login without any trouble, and when I type firebase list
, I get a list of all my current apps. It also tells me which app I'm currently connected to.
My problem is, I want to connect to one of the other apps. I'm running queries on my staging app, and I need to run them on my production app. I can see the production app in the list, but I'm not finding any way to switch to that app.
Thoughts?
Found some useful information here Firebase CLI Reference.
The following code works for me.
to change firebase app destination project you can type "firebase use myProjectName" . i also used the above answeres "firebase list" to check what project i have ( work for me in firebase cli 7.4 with angular 7 app)
I rather use scripts. Consider a project structure like this:
Go to
.firebaserc
and follow the next exampleThen go to
package.json
and add the following scripts (changeToProd
, andchangeToDev
).If your IDE support npm scripts you can run them using the IDE UI, otherwise it can be run using the command console. Make sure you are inside the
functions
folder.You can verify your current project by running the following command from the terminal or added to the scripts as we just did
you can just use a command line switch
In the directory where you run
firebase list
, there will be a file calledfirebase.json
. If you open that in a text editor, you will see the app name in there. You can change it there or deletefirebase.json
to change the app.Or save yourself the hassle of editing a text file and do as Jason says: use
firebase init
.