Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio doesn't see Android processes

I apologize for my English.
I can't attach debugger to process, which I run on my device.
I'm selecting Run->Attach debugger to Android process. Then I check Show all processes in Choose process window, but the processes are not there. My device is identified correctly.

I'm also checking DDMS->Devices in Android Device Monitor. Processes are not there, although my device is identified correctly, and pie Chart on System Information tab display "CPU load" information about all device's processes.

I'm trying:

  • Restarting my Mac;
  • Restarting my device (I have Meizu M2 Note, Android 5.1(API 22);
  • Reenabling Settings->Developer Options->USB debugging on the device
  • Restarting adb by running adb kill-server and adb start-server

I use Android Studio 1.2.2.
I read the similar post Can't attach Android Studio's debugger to Android process, but my post a little about other. I can't see processes even in DDMS.

General problem is the following: I can't test In-app Purchasing. If I test it in debug-mode on my Mac, Google Play does not make a purchase. But if I install application as alpha-tester from Google Play, and run it on device, debugger can't see this application.
What I'm doing wrong?

like image 392
alc77 Avatar asked Nov 09 '22 07:11

alc77


1 Answers

It looks like a cheat, but I solve my problem.

So, I open my project and go to Run->Edit Configurations… I create a new configuration, wherein choose: «Do not deploy anything» in the Package area, «Do not launch Activity» in the Activity area, «USB device» in the Target Device area. I acted according to the document.
Then I choose my run/debug configuration, install logcat’s settings like Log level: "Error", find: {My own TAG}, rightmost filter: "Show only selected application".

Yes, my logs are on Error level. I still have not solved the problem with the spamming logs. Disabling by the ^(?!Surface) doesn't help, but that is another question.

Finally I run application on my device.

Logcat still doesn’t see the running process, but correctly displays its logs.
Perhaps this helps someone else.

like image 197
alc77 Avatar answered Nov 14 '22 21:11

alc77