Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 670
Igor Turchi Avatar asked May 02 '18 15:05

Igor Turchi


People also ask

Why is debug mode not working in ga4?

If you have only an Internal traffic filter active and the developer one is testing or inactive, then you won't see your data in DebugView. Activate the developer filter too. It might take some time until you start seeing data in the debug view after you configure those filters.

How do I enable Analytics debug mode on Android?

To enable Analytics debug mode in your browser, install the Google Analytics Debugger Chrome extension. Once installed, enable the extension and refresh the page. From that point on, the extension will log events in your app in debug mode. You can view events logged in the DebugView in the Firebase console.

How do I enable FIRDebugEnabled?

Enable debug mode by passing the -FIRDebugEnabled argument to the application. You can add this argument in the application's Xcode scheme. When debug mode is enabled via -FIRDebugEnabled, further executions of the application will also be in debug mode.


3 Answers

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.
like image 197
M. Arabi Hasan Sakib Avatar answered Oct 01 '22 02:10

M. Arabi Hasan Sakib


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.

like image 45
LLL Avatar answered Oct 01 '22 02:10

LLL


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

like image 31
Arman Bazarbayev Avatar answered Oct 01 '22 02:10

Arman Bazarbayev