Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Android Studio to /opt in Linux (move the 1.9 GB ~/Android/Sdk to /opt)

I downloaded the new IntelliJ IDEA-based Android Studio - android-studio-ide-135.1641136-linux.zip.

I unpacked the zip file to /opt/android-studio (it was 425 MB unpacked), and executed /opt/android-studio/bin/studio.sh, which started an Install Wizard that installed 1.9 GB worth of data to ~/Android/Sdk. After that, running studio.sh now starts the Android Studio.

I want to move ~/Android/Sdk to /opt/android-sdk, so it can be shared by all users. Also, the users can't have write access to it, since it's in the root partition.

So is this possible?

like image 915
sashoalm Avatar asked Jan 18 '15 12:01

sashoalm


1 Answers

It's intended to be installed per-user, not for-all-users, the main reason being so that individual users can add/update their SDK components as they see fit -- new versions of things are released pretty regularly. It would be a pain for a user to have to ask an administrator to add a missing API level or grab an update. Also, depending on just how security paranoid you are, you may not be comfortable in general running the Android SDK manager as root.

If that's not an important limitation for you, then you can copy/move the SDK directory to its final home; you don't have to run the installer to place it there. Other than for updates, the SDK doesn't write anything to its installation directory, so it should work once copied there.

Having said all that, the Android tools also have a per-user .android directory in the user's home directory. These can't be shared between users, as it contains per-user preferences and AVDs and such. Because of the latter, unfortunately this directory can get quite large.

like image 56
Scott Barta Avatar answered Oct 19 '22 18:10

Scott Barta