Android Studio和Visual Studio是否可以安全地共享相同的Android SDK? [英] Can Android Studio and Visual Studio safely share the same Android SDK?

查看:254
本文介绍了Android Studio和Visual Studio是否可以安全地共享相同的Android SDK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试释放一些磁盘空间,因此除了不想保留其中两个之外,我只想要一份Android SDK.目前,我为每个Android Studio和Visual Studio安装了一个.

I'm trying to free up some disk space and so would like one copy of the Android SDK only, aside from not wanting to maintain two of them. Currently I have one installed for each Android Studio and Visual Studio.

我注意到,现在有一个单独的Xamarin特定的Android SDK管理器,Visual Studio可以使用它来代替Android SDK本身提供的管理器.

I noticed that there is now a separate, Xamarin specific Android SDK manager that Visual Studio uses in place of the one provided by the Android SDK itself.

此外,Visual Studio的Android NDK位于"C:\ ProgramData \ Microsoft \ AndroidNDK" .我不记得在这里专门安装过它(可能使用了默认位置),但是假设Android Studio也可以指向它.

Also, Visual Studio's Android NDK is located at "C:\ProgramData\Microsoft\AndroidNDK". I don't recall installing it there specifically (probably used a default location), but suppose Android Studio could be pointed at it as well.

推荐答案

Android Studio和Visual Studio是否可以安全地共享相同的Android SDK?

Can Android Studio and Visual Studio safely share the same Android SDK?

答案是肯定的,我已经做了很长时间了,而且效果很好.

The answer is Yes, I have done this for a long time and it works fine.

在Visual Studio中,Xamarin Android SDK的默认位置为:

In Visual Studio, Xamarin Android SDK default location is:

C:\Program Files (x86)\Android\android-sdk

C:\ProgramData\Microsoft\AndroidNDK64

在Android Studio中,SDK的默认位置为:

In Android Studio, SDK default location is:

C:\Users\username\AppData\Local\Android\Sdk

C:\Users\username\AppData\Local\Android\Sdk\ndk-bundle

仅使用Visual Studio Android SDK

您可以参考我的

  • 打开Android Studio,转到File-> Project Structure

    将SDK位置更改为Visual Studio SDK位置

    Change the SDK location to your Visual Studio SDK Location

    • a. Change it to Xamarin Android SDK Location: C:\Program Files (x86)\Android\android-sdk
    • b. There is a problem when you change the SDK Location: cannot contain whitespace. You could open CMD as Administrator and type: mklink /J C:\Program-Files-(x86) "C:\Program Files (x86)", like this.
    • c. Then you could change the SDK Location, effect.

    仅使用Android Studio Android SDK

    您只需要更改Xamarin Android设置即可,如上图所示.您可以在以下位置找到它:

    Use Android Studio Android SDK only

    You just need change Xamarin Android settings as the above picture. You could find it in:

    Tools -> Options -> Xamarin -> Android Setting
    

    我担心的是特定于Visual Studio的新SDK经理.

    It is that new visual studio specific sdk manager I'm worried about.

    正如@Muhammad所说,它不会破坏任何东西.

    As @Muhammad said, it won’t broke anything.

    这篇关于Android Studio和Visual Studio是否可以安全地共享相同的Android SDK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆