Igor Turchi
Igor Turchi

Reputation: 81

DebugView no devices available

I'm doing some tests on a small app to understand how firebase-analytics works. This is the code for the MainActivity:

public class MainActivity extends AppCompatActivity {
private FirebaseAnalytics mFirebaseAnalytics;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mFirebaseAnalytics = FirebaseAnalytics.getInstance(getApplicationContext());

    mFirebaseAnalytics.setAnalyticsCollectionEnabled(true);

    mFirebaseAnalytics.setMinimumSessionDuration(10000);

    mFirebaseAnalytics.setSessionTimeoutDuration(300);

    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_ID,"ID");
    bundle.putString(FirebaseAnalytics.Param.ITEM_NAME,"NAME");
    bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE,"image");

    mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
}

To see if my app send data to Firebase I tryed to use DebugView but it says that there isn't any devices available, i also used the command

adb shell setprop debug.firebase.analytics.app <package_name>  

but nothing changed.
If i use these 3 commands

adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC

i can see that my app is sending some data to firebase, like in this picture:

android adb logs

What can i do to enable DebugView and see what my app send to firebase in real time?

Upvotes: 7

Views: 20191

Answers (8)

Arman Bazarbayev
Arman Bazarbayev

Reputation: 69

You can see your list of devices -> adb devices

and then -> adb shell setprop debug.firebase.analytics.app package_name

after that, in Android Studio, run by Debug

Upvotes: 1

user1034912
user1034912

Reputation: 2267

Ok for me.... the reason was because I was having this on my second screen =>

enter image description here

Lessons learnt:

  1. Android Emulators messes up with the ADB and have an impact on firebase debug view.
  2. Don't play games during work... It's 'DIRECTLY' counter productive.

Upvotes: 1

rodmaia
rodmaia

Reputation: 366

Make sure you haven't disabled Firebase Analytics logging either on Gradle or on your manifest.

Upvotes: 1

M. Arabi Hasan Sakib
M. Arabi Hasan Sakib

Reputation: 2696

Please ensure that the following steps have been followed:

Step 1: Your app is properly configured in the Firebase console to support the Analytics features.

Step 2:

A) 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]

B) 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: 9

Taylor A. Leach
Taylor A. Leach

Reputation: 2344

My situation may not be relevant but posting for my future sanity if nothing else.

I had created a new project in firebase and also was having the problem where it said the 'Finish the sdk setup' error trying to communicate with my application (which I had just finished renaming the android package-prompting to create a new project in Firebase)

I was trying to get debugging to work to 'kick' it into connecting, but was getting not devices so I knew there was something wrong.

My issue was my google-services.json filed. It had a reference to my old project name in there AS WELL as my new one. So maybe it was getting confused?

Under client, there were two objects with client_info, api_key, etc. I removed the old one, leaving only the newer correct one.

  "client": [
    {...}, // <-- removed this one
    {...}
  ]

Upvotes: 0

Alexei Masterov
Alexei Masterov

Reputation: 462

I've spent insane amount of time debugging this, and my conclusion - it is the Firebase instability, because I get events intermittently, and there is no pattern to what makes them appear in that DebugView

Upvotes: 2

LLL
LLL

Reputation: 1907

I had the same symptoms as you did. In my case the problem was simply because I forgot to turn on WiFi, so events couldn't be propagated to cloud but were appearing in logcat.

Upvotes: 4

user4571931
user4571931

Reputation:

This command will be helpful to see debug view in firebase analytics:

adb shell setprop debug.firebase.analytics.app

One additional note specified in firebase Google support

Note: Before using DebugView, you should ensure that your device time is accurate. A skewed device clock will result in delayed or missing events in your Analytics reports.

You can refere to below link : https://support.google.com/firebase/answer/7201382?hl=en

Upvotes: 1

Related Questions