- More specifically, this is an offline plug and play approach for when you want to switch computers but your code is not hosted on the web
-
A large capacity external drive (250gb or higher should be more than enough)
-
A base workstation to copy your AS (Android Studio) settings and data from
- Create backups of these directories before proceeding
~/.config/Google/AndroidStudio4.1/options
~/.android
~/AndroidStudioProjects
~/AndroidStudio/DeviceExplorer
# your sdk location may vary
~/Android/Sdk
From your base workstation:
-
copy the
~/Android/Sdk
,~/.android
,~/AndroidStudio/DeviceExplorer
, and~/AndroidStudioProjects
directories to the external drive. You can remove these 4 directories from the Home directory after copying to the external drive. -
create a symlink for the
~/.android
directory linking it to the external drive
example: ln -sfn /media/user/seagate-external-drive/.android ~/.android
-
go to the
~/.config/Google/AndroidStudio4.1/options
directory and remove therecentProjects.xml
file, otherwise AS will hang next time you open it. -
open
~/.config/Google/AndroidStudio4.1/options/project-default.xml
in an editor and update theandroid.sdk.path
property value to point to the android sdk on the external drive.
From your secondary workstation(s):
Assuming you already have AS installed and haven't done the first run setup yet...
-
connect the external drive
-
create a symlink for the
~/.android
directory linking it to the external drive
example: ln -sfn /media/user/seagate-external-drive/.android ~/.android
-
open AS, choose "Custom Setup"
-
on the SDK Components Setup screen, update the sdk path to the location on the external drive.
-
open AS Settings menu, go to
Tools > Device File Explorer
and update theDownload location
path to theAndroidStudio/DeviceExplorer
location on the external drive. -
go to
File > Invalidate Caches & Restart
clickInvalidate and Restart
That is all, now you should be able to freely hop to different workstations and continue work from your external drive. Remember to back up your work regularly.