Reputation: 495
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?
Upvotes: 48
Views: 42954
Reputation: 14328
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
Upvotes: 0
Reputation: 172
All solution didn't fix my issue, If you face it same me try that solution enter link description here
Upvotes: 0
Reputation: 337
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.
Upvotes: 0
Reputation: 1
I followed all the recommendations above, but the problem was solved only after I used the Generate Signed Bundle and selected the desired flavor
Upvotes: 0
Reputation: 31
+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.
Upvotes: 3
Reputation: 199
Verify on AndroidManifest that your LAUNCHER activity has:
android:exported="true"
Upvotes: 7
Reputation: 39
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.sstatic.net/HZF5D.png
image2:--> [2]: https://i.sstatic.net/hrE4a.png
Upvotes: 1
Reputation: 84
Restarted the ABD server. First the device had to be connected. Look for the "Assistant" tab in android studio (on the right side it usually is), and press next until you see the option to reset the ABD server.
Upvotes: 1
Reputation: 727
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.
Upvotes: 19
Reputation: 3687
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.
Upvotes: 0
Reputation: 1050
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.
Upvotes: 0
Reputation: 6234
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).
Upvotes: 2
Reputation: 17705
In command line :
adb kill-server && adb start-server
This command will restart ADB
Upvotes: 4
Reputation: 502
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
....
}
Upvotes: 7
Reputation: 391
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)
Upvotes: 17
Reputation: 2601
You need to restart the ADB.
kill adb.exe process.
how to restart ADB manually from Android Studio
Upvotes: 41