If you don't need to use the device emulators in Eclipse, instead of duplicating the Android Studio SDK directory, you can simply create symbolic links from the new Eclipse directory to the old one for all the subdirectories except tools/
, then in the Eclipse SDK directory extract the v25.2.0 of the tools.
More in detail, for Linux/MacOS:
1) given the existing SDK directory in $TOPDIR/android-sdk
used by Android Studio,
2) create a new empty directory $TOPDIR/android-sdk-eclipse
$ cd $TOPDIR
$ mkdir android-sdk-eclipse
3) for each directory in 1) except tools
:
$ ls -al $TOPDIR/android-sdk
...
drwxrwxr-x 3 xxxuser xxxuser 4096 ott 19 2016 add-ons
drwxrwxr-x 9 xxxuser xxxuser 4096 dic 1 13:58 build-tools
drwxrwxr-x 21 xxxuser xxxuser 4096 ott 26 2016 docs
drwxrwxr-x 7 xxxuser xxxuser 4096 gen 8 14:49 emulator
drwxrwxr-x 5 xxxuser xxxuser 4096 feb 23 2017 extras
drwxrwxr-x 3 xxxuser xxxuser 4096 ott 23 17:05 fonts
-rw-rw-r-- 1 xxxuser xxxuser 16 gen 8 15:26 .knownPackages
drwxrwxr-x 2 xxxuser xxxuser 4096 feb 15 2017 licenses
drwxrwxr-x 3 xxxuser xxxuser 4096 lug 21 11:48 lldb
drwxrwxr-x 12 xxxuser xxxuser 4096 dic 14 12:15 ndk-bundle
drwxrwxr-x 4 xxxuser xxxuser 4096 feb 15 2017 patcher
drwxrwxr-x 23 xxxuser xxxuser 4096 dic 4 14:10 platforms
drwxrwxr-x 5 xxxuser xxxuser 4096 gen 8 14:49 platform-tools
drwxrwxr-x 23 xxxuser xxxuser 4096 dic 12 13:17 skins
drwxrwxr-x 5 xxxuser xxxuser 4096 nov 23 14:16 sources
drwxrwxr-x 12 xxxuser xxxuser 4096 dic 21 13:52 system-images
drwxrwxr-x 2 xxxuser xxxuser 4096 dic 14 2016 temp
drwxrwxr-x 6 xxxuser xxxuser 4096 set 22 10:21 tools
create a symbolic link in directory 2):
$ cd $TOPDIR/android-sdk-eclipse
$ ln -s ../android-sdk/add-ons .
...
$ ln -s ../android-sdk/temp .
3) download the file https://dl.google.com/android/repository/tools_r25.2.5-linux.zip (replace linux with macosx or even windows for other platforms)
in the directory 2) and unzip it:
$ unzip tools_r25.2.5-linux.zip
4) eventually the directory 2) will have the following content:
$ ls $TOPDIR/android-sdk-eclipse
...
lrwxrwxrwx 1 xxxuser xxxuser 22 gen 8 15:13 add-ons -> ../android-sdk/add-ons
lrwxrwxrwx 1 xxxuser xxxuser 26 gen 8 15:13 build-tools -> ../android-sdk/build-tools
lrwxrwxrwx 1 xxxuser xxxuser 19 gen 8 15:13 docs -> ../android-sdk/docs
lrwxrwxrwx 1 xxxuser xxxuser 23 gen 8 15:13 emulator -> ../android-sdk/emulator
lrwxrwxrwx 1 xxxuser xxxuser 21 gen 8 15:13 extras -> ../android-sdk/extras
lrwxrwxrwx 1 xxxuser xxxuser 20 gen 8 15:13 fonts -> ../android-sdk/fonts
lrwxrwxrwx 1 xxxuser xxxuser 23 gen 8 15:13 licenses -> ../android-sdk/licenses
lrwxrwxrwx 1 xxxuser xxxuser 19 gen 8 15:13 lldb -> ../android-sdk/lldb
lrwxrwxrwx 1 xxxuser xxxuser 25 gen 8 15:13 ndk-bundle -> ../android-sdk/ndk-bundle
lrwxrwxrwx 1 xxxuser xxxuser 22 gen 8 15:13 patcher -> ../android-sdk/patcher
lrwxrwxrwx 1 xxxuser xxxuser 24 gen 8 15:13 platforms -> ../android-sdk/platforms
lrwxrwxrwx 1 xxxuser xxxuser 29 gen 8 15:13 platform-tools -> ../android-sdk/platform-tools
lrwxrwxrwx 1 xxxuser xxxuser 20 gen 8 15:13 skins -> ../android-sdk/skins
lrwxrwxrwx 1 xxxuser xxxuser 22 gen 8 15:13 sources -> ../android-sdk/sources
lrwxrwxrwx 1 xxxuser xxxuser 29 gen 8 15:15 system-images -> ../android-sdk/system-images/
lrwxrwxrwx 1 xxxuser xxxuser 19 gen 8 15:13 temp -> ../android-sdk/temp
drwxr-xr-x 12 xxxuser xxxuser 4096 dic 13 2016 tools
-rw-rw-r-- 1 xxxuser xxxuser 277894900 ago 24 17:31 tools_r25.2.5-linux.zip
(to save disk space you can remove the file tools_r25.2.5-linux.zip
once unzipped).
5) set the new directory as the ADT directory in Eclipse: Windows -> Preferences -> Android
, change the field "SDK Location"
to the new directory path $TOPDIR/android-sdk-eclipse
(expand the TOPDIR
placeholder)
This will save 100s of MB on your hard disk, at the same time keeping different tools versions for Android Studio and Eclipse.
The only caveat AFAIK is that the device emulator won't work when launched from Eclipse.