I am making a android studio project and I try to debug my application.
Running the application works fine, but when I try to debug it I get this error:
Could not connect to remote process. Aborting debug session.
What can I do to fix the issue?
I am making a android studio project and I try to debug my application.
Running the application works fine, but when I try to debug it I get this error:
Could not connect to remote process. Aborting debug session.
What can I do to fix the issue?
Sometimes this happens when two Android-capable IDEs are opened, e.g. Android Studio and IDEA. Shutdown one of the two (or disable Android plugin in IDEA) helps.
In My case, For some reason I disabled Instant run and it has changed the Launch value from "Default Activity" to "Nothing" in "Run/Debug configurations". So always it says "Could not connect to remote process. Aborting debug session" and I was not able to debug. I enabled Instant and changed the Launch value from "Nothing" to "Default Activity" in "Run/Debug configurations" and it worked. Hope this will help some one.
(to get Run/Debug configurations, click "app" drop down and click Edit Configurations)
Check if you have selected the right Build Variant, usually "release" comes with debuggable false
Example:
buildTypes {
release {
debuggable false
....
}
}
is not recommendable change release to debuggable true
, just change the right variant
debug {
debuggable true
....
}
Verify on AndroidManifest that your LAUNCHER activity has:
android:exported="true"
In command line :
adb kill-server && adb start-server
This command will restart ADB
+1 to Kuzneц's answer.
When Intellij and Android Studio are both open, apparently the Android plugin in Intellij needs to be disabled. This wasn't always the case but it resolve the issue for me.
By default Android Studio builds the debug
version of the application. However, during the publishing phase you may have switched to the release
one as the tutorial suggests.
ADB won't be able to attach to the application unless you revert to the debug
configuration or you allow to the debug the release
one.
If nothing of this works, you may resort in restarting ADB as explianed in How to restart ADB manually from Android Studio
Revert to debug configuration
debug
in the second columnAllow the release version to be debugged
release
on the rightdebuggable
to true
Keep in mind that your life won't be easy as your application may be optimized and therefore not debugger friendly (e.g. you might not be able to step in certain methods, or view some local variables).
I did
--->adb kill-server && adb start-server
--->invalidate cache / restart
but not work yet
Waiting for application to come online: com.example.distribution_system | com.example.distribution_system.test
Waiting for application to come online: com.example.distribution_system | com.example.distribution_system.test
Waiting for application to come online: com.example.distribution_system | com.example.distribution_system.test
Could not connect to remote process. Aborting debug session.
image1:--> [1]: https://i.stack.imgur.com/HZF5D.png
image2:--> [2]: https://i.stack.imgur.com/hrE4a.png
I got this error message when the phone was connected both via wi-fi (using "adb tcpip 5555" and "adb connect 192.168.0.100:5555" commands) and via a usb cable. Disconnecting the USB cable resolved the issue.
The other solutions posted here did not help me. I eventually discovered that creating a new simulator instance (tools->AVD Manager->Create virtual device) solved my problem. I was unable to get the previous simulator working again.
I followed all the recommendations above, but the problem was solved only after I used the Generate Signed Bundle and selected the desired flavor
For me the problem was a wrong launch flag set in the Run/Debug Configurations. I found out about this by taking the adb command that is executed to launch the app, which can be found in the "Run" tab. The command looks like this:
adb shell am start -n "com.your.package...." -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
By executing the command manually in the terminal, i got an error message which pointed me to the problem.
All solution didn't fix my issue, If you face it same me try that solution enter link description here
Android Studio
create a simple android app but no activity
Android Studio
->Run
->Edit Configuration
->General
->Launch Options
->Launch
: Nothing
Timed out waiting for process to appear on
Processes are not found Aborting session
activity
~= process
Launch
to Default Activity