Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Android Studio 3.0 from command line as root user in Mac

I need to run Android Studio 3.0 in root user to give permission to SDK manager (as SDK Manager is no longer Standalone) to install components to the root directory.

If you are getting Permission Denied errors for any component installation, this can be one of the solutions.

like image 568
Junaid Aziz Avatar asked Nov 14 '17 10:11

Junaid Aziz


People also ask

How do I run as root in Mac terminal?

To run commands with superuser privileges, use the sudo command. sudo stands for superuser do. You're asked for the password of the current user. You're asked to enter the password for adminUsername, after which a new shell is opened for that user.

How do I open Android Studio in terminal?

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.


1 Answers

If you have installed Android Studio in the default Applications directory, this is where it will be. Else you can cd into it's path

cd /Applications/Android\ Studio.app/Contents/MacOS/

then run it as root user by executing

sudo ./studio

like image 118
Junaid Aziz Avatar answered Sep 18 '22 14:09

Junaid Aziz