Reputation: 1183
I linked my Android app with Firebase using Android Studio Which created and set my google-service.json into my project.
When i debug my event logging in logcat i got :
V/FA-SVC: Successful upload. Got network response. code, size: 204, 0
But nothing is showing into firebase console debug view
Upvotes: 114
Views: 166494
Reputation: 11
There's one option that worked for me
adb shell setprop debug.firebase.analytics.app com.yourapp in your ..\AppData\Local\Android\Sdk\platform-tool
Upvotes: 0
Reputation: 281
Delete the App on the device/emulator first!
From the terminal run:
adb shell setprop debug.firebase.analytics.app [your_app_package_name]
Then rebuild/debug the app on your device/emulator.
Finally your debug data will show up in Firebase > Analytics > DebugView
People have said "erase content and settings" and "clear the app storage"...etc, but I didn't get it and have spent hours trying to get this working. All you need to do to clear this out is delete the app from your device. Debug won't work unless all the app data is cleared out.
If you are looking for your_app_package_name, its in your AndroidManifest.xml file under package.
UPDATE 2023: If you are looking for your_app_package_name, it now could be in your build.gradle file under applicationId.
Upvotes: 19
Reputation: 3312
Firstly, You should delete the App on the device or emulator.
I faced a similar situation. I ran the following command on Windows device
adb shell setprop debug.firebase.analytics.app "app_package_name"
You can find out from AndroidManifest.xml
file.
It's worked.
Upvotes: 1
Reputation: 126
Thanks GETEM5 for idea. I have tried everything possible, but no result. After moving the application to the background, the application disconnected from the debugger, it unloaded, launched it again from the application icon and the device appeared in DebugView in realtime...but can help just moving to the background for sending i think.
Upvotes: 0
Reputation: 43
After trying every potential solution on the internet, and none of them working. These are the steps I used to finally enable DebugView to find my device:
Close the app on the device you’re working on
Go to the Firebase console and sign out of your account
Sign back in again, go to the console and select the project you’re working on.
Again, not sure if this made a difference however do NOT click on DebugView item under the “Project shortcuts” list. Instead, click on the “Analytics” drop-down and select DebugView from there.
It may be possible that this process updates the data stream used in the DebugView page - after following these steps I noticed events which had been missed initially were now showing up - almost as if the event was sent/received properly however the DebugView wasn’t showing the correct data stream.
Bonus tip:
Had issues with this again today, and after signing out/in to Firebase the DebugView still wasn't finding my device. What fixed it was, on my device, move the app into the background i.e. swipe up from the bottom to go to the home screen...
When you re-open the app into the foreground, the DebugView should now start displaying events. I imagine this works because the action of moving the app into the background I believe triggers any saved events on the device to be sent to Firebase, essentially flushing the queue.
Upvotes: 1
Reputation: 2942
I'm having the same issue. DebugView works fine with emulator, but distributed app isn't getting picked up. I've checked the schemas and they include the flag:
<CommandLineArgument
argument = "-FIRDebugEnabled"
isEnabled = "YES">
Any ideas how to make it work on distributed app? I'm using AppCenter just in case.
Upvotes: -1
Reputation: 2740
Use this command to enable firebase debug mode on your device.
adb shell setprop debug.firebase.analytics.app yourappid
Use the following command to check the app id (package name) if you are not sure.
aapt dump badging path-to-your-apk
for example: aapt dump badging c:\myapp.apk
And make make sure your app is using the expected google app id especially when the app has variants.
You can use apktool
to un-package your apk, and find the google_app_id
in /res/values/strings
which should be the same as the app id in the firebase project setting.
If the google_app_id
of your apk is not expected, you may need to check if it's using the right google-services.json
.
Clean your project and rebuild, if everything look good.
Upvotes: 0
Reputation: 9512
If everything is properly set up and still Debug View is not working
I face this issue even though I have enabled the Debug view via command and cross-checked with some other device & system which works properly. But somehow it was not working on my emulator. This might also happen on a real device.
Solution for not working only on a specific device or emulator in the system:
To see the logs & events in Debug View. We need to make sure that the emulator or device Date & Time with Timezone are set to our local time which should be also the same in the analytics console. After making same date and time I was able to see the logs & event in Debug View.
I hope this might help those who have followed all the things correctly but missed this case.
Upvotes: 0
Reputation: 53
In my case, I did two things:
Firstly
I add the following command in android studio Terminal
adb shell setprop debug.firebase.analytics.app [your_application_id]
Secondly:
I went to the Developer Options on my phyiscal device, and i clicked "Select debug app", then i chose my app.
then my device appeared on Debug View devices.
Upvotes: 4
Reputation: 1
install the required NDK version for your project. Version 21.0.6113669 worked for me
Upvotes: -1
Reputation: 2469
First of all check if your bebugging device is connected to the internet, because without an active internet connection Firebase will of course not receive any debugging data.
Secondly, your debugging device may be showing multiple times on Firebase Analytics Debug View, like mine was.
Strangely enough, you'll have to select the correct item corresponding to your currently running device so that you can see the live logs. It looks like Google keeps your device listed from previous debugging sessions, rather than replacing the session with the current one, which in my opinion would be the right approach to follow.
Upvotes: 2
Reputation: 81
I'm not sure if you have received your answer or not, but one thing that got me snagged up was all the directions say to do, is enter this command and use your package name. BUT, if you are using flavors and adding package suffixes then you must make sure you have that in the shell command as well.
If you have a dev / uat / prod variant/flavor combo , make sure that you are adding the suffix if you have one. In my instance I have a '.dev' suffix, so my command looks as follows:
adb shell setprop debug.firebase.analytics.app com.myapp.something.dev
Upvotes: 0
Reputation: 2837
If you are on iOS simulator. Try this:
Step1 : "Erase All content and settings" on simulator and let the simulator start again
Step2 : start your app
Step3 : Close the firebase debug tab and start again.
The debug logs were not coming for me and after doing this I am successfully getting the logs.
Note : The above thing happened atleast 7/8 times from past few days.
Upvotes: 0
Reputation: 883
After reading the comment here, I found it helpful to run the following commands from a terminal:
adb kill-server
adb start-server
adb shell setprop debug.firebase.analytics.app package_name
Then I was able to select my emulator from the Firebase debug device list and see Firebase events from an app running in Android Studio Bumblebee | 2021.1.1 Beta 1
Upvotes: 2
Reputation: 1103
In my case, even running the adb shell setprop debug.firebase.analytics.app "your.app.package.name"
didn't help. While I was hopelessly trying to find something, I decided to check the firebase plugin for Android Studio for something related and found out under the section for analytics that the following commands are needed for verbose logging:
adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC
I thought that it might be helpful at least to see if the app is sending out some tracking information to the servers at all and run those commands. For my big surprise, it helped also the DebugView and I was then able to see my device.
Upvotes: 36
Reputation: 12292
I configured everything correctly and had an emulator and a device running. The emulator events showed up, but the device didn't. 2 hours later I figured out that there is a device-selector in the DebugView
and selecting the device was showing the events all the time:
Upvotes: 0
Reputation: 4055
I had problems with events and devices not showing up in the Firebase Debug View.
Found out that my pi-hole on my network was eating all the events. So if if you have any kind of ad blocker on your network, disable it and try again.
Upvotes: 2
Reputation: 69
In my case, I replaced previous google-services.json file with new one. For this case, I needed to remove the "build" folder, rebuild the project, did debug run on device also followed other steps like, adb shell setprop debug.firebase.analytics.app "your.app.package.name" too. Then it worked.
Upvotes: -1
Reputation: 4590
Test device setup
To enable sending of DebugView data on a connected Android test device for a configured Firebase Analytics app, you can follow the step below:
If you are simply working with single build variant, the following command is enough:
adb shell setprop debug.firebase.analytics.app [your_app_package_name]
But if you are working with multiple build variants with different application IDs which are not the same as the app package name, be sure to execute the following command:
adb shell setprop debug.firebase.analytics.app [your_application_id]
Here, application ID is the app ID of your build variant found in the corresponding gradle file. For example, lets say you have x.gradle and y.gradle for two build variants x and y, and you also have the general build.gradle file. To debug the build variant x with application ID com.abc.x, the command will be:
adb shell setprop debug.firebase.analytics.app com.abc.x
Similarly, to debug the build variant y with application ID com.abc.y, the command will be:
adb shell setprop debug.firebase.analytics.app com.abc.y
This behavior persists until you explicitly disable it by executing the following command:
adb shell setprop debug.firebase.analytics.app .none.
Upvotes: 117
Reputation: 421
After performing steps from Enabling debug mode, make sure that date and time on your debug device or emulator and on your PC is correct.
If after correcting the date and time events are still not showing on DebugView, clear the app storage. Then restart the app and try again.
Upvotes: 37
Reputation: 1667
For me the problem was using "package name" in the adb command as they suggest in the docs. But whay you must use is the applicationId of your build. Though they are the same a lot of times they can be different if you specify another appId in build.gradle
file or add postfixes for some specific build variants.
I don't know why they always use the "package name" words for it, since it just means the way we organize our code.
Upvotes: 5
Reputation: 792
Disable any ad-blocking mechanism in your debugging device. This was the problem here. I had AdAway enabled.
I know the question is old, however it may help someone.
Upvotes: 6
Reputation: 1148
You will see your device listed in Firebase DebugView
Upvotes: 61
Reputation: 75
As others have mentioned, I think commonly the issue here is using the wrong package name. I had this problem with an app I recently started collaborating on, and using the package attribute from AndroidManifest.xml wasn't working. I suspected that the build was appending something to the package name but couldn't find the place where this was defined. The simplest way I found to discover the actual package name was to launch "Attach debugger to Android process" in the top bar on Android Studio, which then shows a list of processes with their associated package names on the AVD. Sure enough, using the correctly-appended package name taken from this list did then cause Firebase Analytics Debug View to wake up.
Upvotes: 5
Reputation: 10342
Also make sure that you have the latest Google Play Services installed in the device/emulator or nothing is guaranteed to work.
If you go to the settings on your emulator, there is Update button for that. Unfortunately it requires you to sign-in via your Google account.
Upvotes: 10
Reputation: 5767
Enabling debug logging is different from enabling debug mode. As Frank van Puffelen suggested in his comment, to enable debug mode you need to set "debug.firebase.analytics.app" property to your app package name.
You can do this using adb with the following command:
adb shell setprop debug.firebase.analytics.app "your.app.package.name"
You can find the package name of your app inside your AndroidManifest.xml
as the package
attribute on the manifest
element (first element in the xml document).
Upvotes: 28