I'm Ubuntu & Android beginner. I need help to close Android Studio using the terminal or a solution to resolve the error which is shown in this image:
In Linux, you can use the Ctrl+C keys to stop a running program in the terminal. This works for Ubuntu as well as any other Linux distribution.
How To Close, Save Android Studio Project. To close the project you need to click the ” File —> Close Project ” menu in the top menu bar. To save the Android project, you need to click the ” File —> Save All ” menu in the top menu bar.
To exit a session, touch Close Session from the menu . If you are the session owner, End Session closes the session page in your access console and removes any additional members who may be sharing the session.
To launch Android Studio, open a terminal, navigate to the android-studio/bin/ directory, and execute studio.sh . Select whether you want to import previous Android Studio settings or not, then click OK.
pkill java
Is the easiest one.
EDIT
Many people have made use of the command above, however, there is a drawback to using it: All Java applications running as your user will be killed.
To fix this, I've made a oneliner which will kill one Android Studio instance. This may or may not work on your particular system but is a better solution than the one mentioned above if it happens to work for you.
ps -eo pid,cmd | grep -Ev "^ {0,1}([0-9]*) grep.*" | grep -E 'java.*android-studio' | sed -re 's/ {0,1}([0-9]*) .*/\1/' | head -n1 | xargs kill -9
This will search for java.*android-studio
in the commands of your process list and kill the associated process using its PID.
killall -9 java
It works for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With