I recently destroyed my good old Nexus 6 phone. It’s still working, but display screen is broken. Due to this fact, I’ve had an excuse to buy new Pixel 2 phone. It’s pretty expansive, but its quality is really good. As usual, I wanted to debug an app on this device and encountered problem related to device permissions.

Once I connected the phone, to my laptop and typed adb devices, I’ve seen the following message:

and I couldn’t debug my apps.

Later, I enabled debugging in:

Of course, in order to see these options, we need to tap several times on the compilation number first in:

After that, debug options will be enabled

Nevertheless, I still couldn’t debug my apps!

I realized, I have connected phone just for charging

Once, I switched it to “Transfer files”, I could finally debug my phone.

It’s important to note, that it’s good to restart adb (Android Debug Bridge) after changing connection mode to avoid any further problems.

We can do this as follows:

Now, we should see the following message:

Next, we can type adb devices again and we see that our device is finally attached.

Now, we can install our apps or run logcat with adb logcat command or even more fancy colored pidcat if we want to.

I hope, you will find this post useful in case of having similar issues.