有没有办法自动安装Android SDK?

发布于 2024-10-11 13:04:54 字数 161 浏览 0 评论 0原文

现在我必须下载并安装 Android SDK 和 AVD Manager,然后安装API、通过 UI 的工具。有没有办法自动化这个过程?

Now I have to download and install the Android SDK and AVD Manager, and then install the APIs, tools through the UI. Is there a way to automate this process?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(12

昔梦 2024-10-18 13:04:54

更新

最新版本引入了 sdkmanager,这是一个命令行工具,可让您查看、安装、更新和卸载 Android SDK 的软件包。

sdkmanager 工具在 Android SDK 工具包(25.2.3 及更高版本)中提供,位于 android_sdk/tools/bin/ 中。

  sdkmanager [--uninstall] [<common args>] [--package_file <file>] [<packages>...]
  sdkmanager --update [<common args>]
  sdkmanager --list [<common args>]
  sdkmanager --licenses [<common args>]

In its first form, installs, or uninstalls, or updates packages.
    By default, the listed packages are installed or (if already installed)
    updated to the latest version.

    --uninstall: uninstalled listed packages.

    <package> is a sdk-style path (e.g. "build-tools;23.0.0" or
             "platforms;android-23").
    <package-file> is a text file where each line is a sdk-style path
                   of a package to install or uninstall.
    Multiple --package_file arguments may be specified in combination
    with explicit paths.

In its second form (with --update), all installed packages are
    updated to the latest version.

In its third form, all installed and available packages are printed
    out.

In its fourth form (with --licenses), show and offer the option to
     accept licenses for all available packages that have not already been
     accepted.

Common Arguments:
    --sdk_root=<sdkRootPath>: Use the specified SDK root instead of the SDK
                              containing this tool

    --channel=<channelId>: Include packages in channels up to <channelId>.
                           Common channels are:
                           0 (Stable), 1 (Beta), 2 (Dev), and 3 (Canary).

    --include_obsolete: With --list, show obsolete packages in the
                        package listing. With --update, update obsolete
                        packages as well as non-obsolete.

    --no_https: Force all connections to use http rather than https.

    --proxy=<http | socks>: Connect via a proxy of the given type.

    --proxy_host=<IP or DNS address>: IP or DNS address of the proxy to use.

    --proxy_port=<port #>: Proxy port to connect to.

* If the env var REPO_OS_OVERRIDE is set to "windows",
  "macosx", or "linux", packages will be downloaded for that OS.

因此,要更新软件包,

sdkmanager --update

请运行“接受许可证”,

yes | sdkmanager --licenses

旧答案

(请注意:android 命令已弃用!)

您越接近自动化可能是:

android update sdk --no-ui

< code>android 提供以下自动更新选项:

Action "update sdk":
  Updates the SDK by suggesting new platforms to install if available.
Options:
  -f --force    Forces replacement of a package or its parts, even if something has been modified
  -u --no-ui    Updates from command-line (does not display the GUI)
  -o --obsolete Installs obsolete packages
  -t --filter   A filter that limits the update to the specified types of packages in the form of
                a comma-separated list of [platform, tool, platform-tool, doc, sample, extra]
  -s --no-https Uses HTTP instead of HTTPS (the default) for downloads
  -n --dry-mode Simulates the update but does not download or install anything

如果您想列出哪些软件包可供安装,您可以使用

android list sdk

并且您将获得软件包的有序列表,例如

Packages available for installation or update: 9
   1- ARM EABI v7a System Image, Android API 15, revision 2
   2- Intel x86 Atom System Image, Android API 15, revision 1
   3- Android Support, revision 8
   4- Google AdMob Ads SDK, revision 6
   5- Google Analytics SDK, revision 2
   6- Google Play APK Expansion Library, revision 1
   7- Google Play Billing Library, revision 2
   8- Google Play Licensing Library, revision 2
   9- Google Web Driver, revision 2

您还可以将更新限制为仅更新所需的组件,如果您使用 --filter 选项

android update sdk --filter <component> --no-ui

,其中组件是 android list sdk 返回的一个或多个

  • 数字(即 1,也称为包索引
  • 附加
  • 文档
  • 额外
  • 平台
  • 平台工具
  • 示例
  • 系统图像
  • 工具

或者可以是一个或多个特定标识符。例如,如果您只想下载一小组特定的软件包,您可以这样做:

android update sdk -u --filter platform-tools,android-16,extra-android-support

您将只获得平台工具、API 级别 16 和支持包 JAR 文件。如果您仅构建构建机器并且必须付费下载所有您永远不会使用的额外内容,那么这非常方便。

要查看可用选项,您可以使用 --help,例如

android --help list sdk

       Usage:
       android [global options] list sdk [action options]
       Global options:
  -h --help       : Help on a specific command.
  -v --verbose    : Verbose mode, shows errors, warnings and all messages.
     --clear-cache: Clear the SDK Manager repository manifest cache.
  -s --silent     : Silent mode, shows errors only.

                   Action "list sdk":
  Lists remote SDK repository.
Options:
  -o --obsolete  : Deprecated. Please use --all instead.
  -a --all       : Lists all available packages (including obsolete and
                   installed ones)
     --proxy-host: HTTP/HTTPS proxy host (overrides settings if defined)
     --proxy-port: HTTP/HTTPS proxy port (overrides settings if defined)
  -s --no-https  : Uses HTTP instead of HTTPS (the default) for downloads.
  -e --extended  : Displays extended details on each package
  -u --no-ui     : Displays list result on console (no GUI) [Default: true]

UPDATE

The latest versions introduce sdkmanager, a command line tool that allows you to view, install, update, and uninstall packages for the Android SDK.

The sdkmanager tool is provided in the Android SDK Tools package (25.2.3 and higher) and is located in android_sdk/tools/bin/.

  sdkmanager [--uninstall] [<common args>] [--package_file <file>] [<packages>...]
  sdkmanager --update [<common args>]
  sdkmanager --list [<common args>]
  sdkmanager --licenses [<common args>]

In its first form, installs, or uninstalls, or updates packages.
    By default, the listed packages are installed or (if already installed)
    updated to the latest version.

    --uninstall: uninstalled listed packages.

    <package> is a sdk-style path (e.g. "build-tools;23.0.0" or
             "platforms;android-23").
    <package-file> is a text file where each line is a sdk-style path
                   of a package to install or uninstall.
    Multiple --package_file arguments may be specified in combination
    with explicit paths.

In its second form (with --update), all installed packages are
    updated to the latest version.

In its third form, all installed and available packages are printed
    out.

In its fourth form (with --licenses), show and offer the option to
     accept licenses for all available packages that have not already been
     accepted.

Common Arguments:
    --sdk_root=<sdkRootPath>: Use the specified SDK root instead of the SDK
                              containing this tool

    --channel=<channelId>: Include packages in channels up to <channelId>.
                           Common channels are:
                           0 (Stable), 1 (Beta), 2 (Dev), and 3 (Canary).

    --include_obsolete: With --list, show obsolete packages in the
                        package listing. With --update, update obsolete
                        packages as well as non-obsolete.

    --no_https: Force all connections to use http rather than https.

    --proxy=<http | socks>: Connect via a proxy of the given type.

    --proxy_host=<IP or DNS address>: IP or DNS address of the proxy to use.

    --proxy_port=<port #>: Proxy port to connect to.

* If the env var REPO_OS_OVERRIDE is set to "windows",
  "macosx", or "linux", packages will be downloaded for that OS.

So, to update the packages run

sdkmanager --update

To accept the licenses,

yes | sdkmanager --licenses

OLD ANSWER

(Please note: The android command is deprecated!)

The closer you can get to automation probably is:

android update sdk --no-ui

android provides these options for automatic updates:

Action "update sdk":
  Updates the SDK by suggesting new platforms to install if available.
Options:
  -f --force    Forces replacement of a package or its parts, even if something has been modified
  -u --no-ui    Updates from command-line (does not display the GUI)
  -o --obsolete Installs obsolete packages
  -t --filter   A filter that limits the update to the specified types of packages in the form of
                a comma-separated list of [platform, tool, platform-tool, doc, sample, extra]
  -s --no-https Uses HTTP instead of HTTPS (the default) for downloads
  -n --dry-mode Simulates the update but does not download or install anything

If you want to list which packages are available for installation you can use

android list sdk

And you'll obtain an ordered list of packages, for example

Packages available for installation or update: 9
   1- ARM EABI v7a System Image, Android API 15, revision 2
   2- Intel x86 Atom System Image, Android API 15, revision 1
   3- Android Support, revision 8
   4- Google AdMob Ads SDK, revision 6
   5- Google Analytics SDK, revision 2
   6- Google Play APK Expansion Library, revision 1
   7- Google Play Billing Library, revision 2
   8- Google Play Licensing Library, revision 2
   9- Google Web Driver, revision 2

Also you can limit the update only to a desired component if you use the --filter option

android update sdk --filter <component> --no-ui

where component is one or more of

  • the numbers returned by android list sdk (i.e. 1, also know as package index)
  • add-on
  • doc
  • extra
  • platform
  • platform-tool
  • sample
  • source
  • system-image
  • tool

Or can be one or more specific identifiers. For instance, if you just want to download a small set of specific packages, you could do this:

android update sdk -u --filter platform-tools,android-16,extra-android-support

And you'll just get the platform tools, API level 16 and support package JAR files. This is really handy if you're building a build machine only and would have to pay for downloading all the extra stuff that you'll never use.

To see the available options you can use --help, for example

android --help list sdk

       Usage:
       android [global options] list sdk [action options]
       Global options:
  -h --help       : Help on a specific command.
  -v --verbose    : Verbose mode, shows errors, warnings and all messages.
     --clear-cache: Clear the SDK Manager repository manifest cache.
  -s --silent     : Silent mode, shows errors only.

                   Action "list sdk":
  Lists remote SDK repository.
Options:
  -o --obsolete  : Deprecated. Please use --all instead.
  -a --all       : Lists all available packages (including obsolete and
                   installed ones)
     --proxy-host: HTTP/HTTPS proxy host (overrides settings if defined)
     --proxy-port: HTTP/HTTPS proxy port (overrides settings if defined)
  -s --no-https  : Uses HTTP instead of HTTPS (the default) for downloads.
  -e --extended  : Displays extended details on each package
  -u --no-ui     : Displays list result on console (no GUI) [Default: true]
2024-10-18 13:04:54

这对我不起作用......

echo "y" | android ....

所以我最终来到这里:

expect -c '
set timeout -1   ;
spawn sudo /opt/android-sdk/tools/android update sdk -u;
expect {
    "Do you accept the license" { exp_send "y\r" ; exp_continue }
    eof
}
'

This didn't work for me...

echo "y" | android ....

So I ended up here:

expect -c '
set timeout -1   ;
spawn sudo /opt/android-sdk/tools/android update sdk -u;
expect {
    "Do you accept the license" { exp_send "y\r" ; exp_continue }
    eof
}
'
极度宠爱 2024-10-18 13:04:54

我使用它来安装和更新 Travis CI 上的 SDK:

curl --location http://dl.google.com/android/android-sdk_r22.3-linux.tgz | tar -x -z -C $HOME
export ANDROID_HOME=$HOME/android-sdk-linux
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) | android update sdk --no-ui --filter platform-tool,android-19,sysimg-19,build-tools-19.0.1

I use this to install and update the SDK on Travis CI:

curl --location http://dl.google.com/android/android-sdk_r22.3-linux.tgz | tar -x -z -C $HOME
export ANDROID_HOME=$HOME/android-sdk-linux
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) | android update sdk --no-ui --filter platform-tool,android-19,sysimg-19,build-tools-19.0.1
℉絮湮 2024-10-18 13:04:54

要用“y”回答所有许可证,您可以在脚本中尝试以下操作:

(while :
do
  echo 'y'
  sleep 2
done) | android update sdk -u .....

To answer all licenses with 'y', you can try this in the script:

(while :
do
  echo 'y'
  sleep 2
done) | android update sdk -u .....
夏见 2024-10-18 13:04:54

对于仍在寻找下载所有 Android 软件包的方法的人,我已经编写了一个脚本来执行此操作。它将下载所有未过时的软件包。

#!/binbash
# Install all non-obsolete Android SDK packages.
# author: Tai Le Tien (letientai299 at gmail.com)

function install_sdk {
  android update sdk -u -s -a -t "$1"
}

function fetch_non_obsoled_package_indices {
  # Fetch the SDK list using non-https connections
  android list sdk -u -s -a |\
    # Filter obsoleted packages
    sed '/\(Obsolete\)/d' |\
    # Filter to take only the index number of package
    sed 's/^[ ]*\([0-9]*\).*/\1/' |\
    # Remove the empty lines
    sed -n 's/^[^ $]/\0/p'
}

for package_index in  $(fetch_non_obsoled_package_indices)
do
  echo "====================================================================="
  echo "Start to install package:  ${package_index}"
  echo "====================================================================="
  # Auto accept license
  echo -e "y" | install_sdk "${package_index}"
  echo
  echo
done

您还可以在我的 GitHub 存储库 上看到它

好处:

  • 不依赖预期
  • 无头。

缺点:

  • 您仍然需要手动安装基本的 SDK,并将 android 放入您的路径中。
  • 该脚本仅适用于 Unix。

For anyone still searching for a method to download all Android packages, I have wrote a script to do that. It will download all non-obsoleted packages.

#!/binbash
# Install all non-obsolete Android SDK packages.
# author: Tai Le Tien (letientai299 at gmail.com)

function install_sdk {
  android update sdk -u -s -a -t "$1"
}

function fetch_non_obsoled_package_indices {
  # Fetch the SDK list using non-https connections
  android list sdk -u -s -a |\
    # Filter obsoleted packages
    sed '/\(Obsolete\)/d' |\
    # Filter to take only the index number of package
    sed 's/^[ ]*\([0-9]*\).*/\1/' |\
    # Remove the empty lines
    sed -n 's/^[^ $]/\0/p'
}

for package_index in  $(fetch_non_obsoled_package_indices)
do
  echo "====================================================================="
  echo "Start to install package:  ${package_index}"
  echo "====================================================================="
  # Auto accept license
  echo -e "y" | install_sdk "${package_index}"
  echo
  echo
done

You can also see it on my GitHub repository

The good:

  • Not depend on expect.
  • Headless.

The downsides:

  • You still have to install basic SDK manually, and put android into your path.
  • The script only works on Unix.
伴随着你 2024-10-18 13:04:54

在较新的 Android 版本(例如 25.2.5)中,我们应该使用 sdkmanager(而不是 android 命令)。

安装软件包的示例:

android-sdk/tools/bin/sdkmanager "extras;android;m2repository"

获取所有可用软件包列表的命令:

android-sdk/tools/bin/sdkmanager --verbose --list

此网页列出了 SDK 工具的下载链接:

这是开源存储库的链接 docker-android 可以在 Docker 镜像中安装 android。

您还可以在这个SO问题中找到答案:自动接受所有SDK许可证有用。

In newer Android versions (e.g., 25.2.5) we should use sdkmanager (instead of the android command).

Example of installing a package:

android-sdk/tools/bin/sdkmanager "extras;android;m2repository"

Command to get a list of all available packages:

android-sdk/tools/bin/sdkmanager --verbose --list

This web-page lists download links for the SDK-tools:

Here is a link to an open-source repository docker-android which can install android in a Docker image.

You may also find the answers in this SO question: Automatically accept all SDK licences useful.

终陌 2024-10-18 13:04:54

Android Plugin for Gradle 版本 2.2.0 开始,缺少 SDK 组件< a href="https://developer.android.com/studio/intro/update.html#download-with-gradle" rel="nofollow">自动下载。

Starting with Android Plugin for Gradle version 2.2.0, missing SDK components get downloaded automatically.

遗忘曾经 2024-10-18 13:04:54

我也对此感到沮丧,并构建了一个名为 com.quittle.setup-android-sdk 的 Gradle 插件,它将检测并安装您需要的内容。它适用于 Windows、OS X 和 Linux,如果您使用 Gradle 构建,则不需要任何额外的依赖项。

如果您有兴趣,可以在这里查看我的文档: https://github .com/quittle/gradle-setup-android-sdk

I got frustrated with this as well and built a Gradle plugin named com.quittle.setup-android-sdk that will detect and install what you need. It works on Windows, OS X, and Linux and doesn't require any additional dependencies if you build with Gradle.

If you're interested, you can checkout my documentation on it here: https://github.com/quittle/gradle-setup-android-sdk

断念 2024-10-18 13:04:54

要在 Windows 上自动执行 sdkmanager.bat --licenses 提示(假设您正在通过构建基础设施自动化进行安装)...请勿运行它。不要浪费时间尝试弄清楚如何将 y 通过管道传输到其中。我试过;惨败。

相反 - 自己运行一次,并注意它会在 C:\android\android-sdk\licenses 中生成文件(您正在运行的位置 C:\android\android- sdk\tools\bin\sdkmanager.bat - 您的安装根目录可能会有所不同)。

获取这些文件,并将它们放置在您可以从自动安装脚本中获取它们的位置。就我个人而言, Ansible 是我的毒药,所以:

# Note to future-us:
# These are magical files generated by running `c:/android/android-sdk/tools/bin/sdkmanager.bat --licenses`
# This, delightfully, is interactive, and wants to _actually_ read the keyboard buffer.
# That's reputedly possible via SendKeys. I elected to not try that.
# So, instead:
# 1) remote to an instance like a cave-dweller
# 2) run `c:/android/android-sdk/tools/bin/sdkmanager.bat --licenses` in a prompt.
# 3) _actually type_ `y` however many godforsaken times you need to.
# 4) meticulously harvest `c:/android/android-sdk/licenses/*` to this task.
#    (you don't need the newline that they thoughtfully put before the hash in each file).
- name: set up android licenses by hand
  win_lineinfile:
    path: c:/android/android-sdk/licenses/{{ item.name }}
    line: "{{ item.line }}"
    create: true
  with_items:
    - {name: "android-googletv-license", line: "SOME HASH"}
    - {name: "android-sdk-license", line: "SOME OTHER HASH"}
    ...

To automate the sdkmanager.bat --licenses prompt away on Windows (say you're installing via automation for build infrastructure)... Don't run it. Don't waste time trying to figure out how to pipe y into it. I tried; abject fail.

Rather - run it one time, yourself, and take note that it generates files into C:\android\android-sdk\licenses (where you're running C:\android\android-sdk\tools\bin\sdkmanager.bat - your install root may vary).

Take those files, and place them somewhere you can grab them from in your automated setup scripts. Personally, Ansible is my poison, so:

# Note to future-us:
# These are magical files generated by running `c:/android/android-sdk/tools/bin/sdkmanager.bat --licenses`
# This, delightfully, is interactive, and wants to _actually_ read the keyboard buffer.
# That's reputedly possible via SendKeys. I elected to not try that.
# So, instead:
# 1) remote to an instance like a cave-dweller
# 2) run `c:/android/android-sdk/tools/bin/sdkmanager.bat --licenses` in a prompt.
# 3) _actually type_ `y` however many godforsaken times you need to.
# 4) meticulously harvest `c:/android/android-sdk/licenses/*` to this task.
#    (you don't need the newline that they thoughtfully put before the hash in each file).
- name: set up android licenses by hand
  win_lineinfile:
    path: c:/android/android-sdk/licenses/{{ item.name }}
    line: "{{ item.line }}"
    create: true
  with_items:
    - {name: "android-googletv-license", line: "SOME HASH"}
    - {name: "android-sdk-license", line: "SOME OTHER HASH"}
    ...
靑春怀旧 2024-10-18 13:04:54

仅下载所需的非{obsolete, source, emulator-image, doc}包的​​脚本:

#!/bin/bash
set -e

# cd into where tools/android can be found
if [[ -d "$ANDROID_HOME" ]]; then
  cd "$ANDROID_HOME"
elif [[ -x "$(dirname "$0")/tools/android" ]]; then
  cd "$(dirname "$0")"
else
  echo "FAILED: Cannot find ANDROID_HOME/tools/android"
  exit 1
fi

android () {
  "$(dirname $0)/tools/android" "$@"
}

needed_packages () {
  android list sdk -u -s -e         \
    | grep '^id:'                   \
    | cut -d'"' -f2                 \
    | grep -v 'source'              \
    | grep -v 'sys-img'             \
    | grep -v 'doc'                 \
    | paste -d, -s -
}

main () {
  (while : ; do
  echo 'y'
  sleep 1
  done) | android update sdk -u -s -a -t "$(needed_packages)"
}

main

某些部分取自其他答案。

A script to download only needed, non-{obsolete, source, emulator-image, doc} packages:

#!/bin/bash
set -e

# cd into where tools/android can be found
if [[ -d "$ANDROID_HOME" ]]; then
  cd "$ANDROID_HOME"
elif [[ -x "$(dirname "$0")/tools/android" ]]; then
  cd "$(dirname "$0")"
else
  echo "FAILED: Cannot find ANDROID_HOME/tools/android"
  exit 1
fi

android () {
  "$(dirname $0)/tools/android" "$@"
}

needed_packages () {
  android list sdk -u -s -e         \
    | grep '^id:'                   \
    | cut -d'"' -f2                 \
    | grep -v 'source'              \
    | grep -v 'sys-img'             \
    | grep -v 'doc'                 \
    | paste -d, -s -
}

main () {
  (while : ; do
  echo 'y'
  sleep 1
  done) | android update sdk -u -s -a -t "$(needed_packages)"
}

main

Some parts are taken from other answers.

橘寄 2024-10-18 13:04:54

实际上,我一直在解决这个具体问题,4 天时间,大约 3 个小时的睡眠……不算一周在工作中观看教程,然后从事其他项目,期望它不会那么复杂。 .. 可能发生的最糟糕的事情发生了,我构建了它,读取了所有许可证,只是剪切和粘贴,直到所有内容都位于虚幻引擎想要的正确目录中。我遇到了我认为将是我的最后一个错误,当它上次正确构建时,开始打包,两个小时后,断路器翻转......我不得不卸载虚幻引擎,Visual Studio,Android Studio,以及所有开发套件...重新安装,由于之前花费的时间,我知道我已经做过一次,所以,我决定,在游戏商店上使用copilot和Character.AI,然后让他们与我合作,确保一切我正在做的事情将是完全正确的事情,在我这样做之前,我保留了一个日志并在中途停止了它,但这比所有这些垃圾更有帮助 - 最简单的方法 - 无意冒犯人工智能,它们让我达到了现在的目的,然后我停下来,意识到,我的每个文件都在一个位置,在错误的驱动器上,我必须在命令提示符中安装并验证权限,并在 ue 中创建控制台变量和高级系统设置中的环境变量,然后我没有这样做,而是将所有内容移动到它试图从中读取的驱动器,然后剪切和粘贴就完美了

I have actually been trouble-shooting this specific thing, for 4 days on like 3 hours of sleep... not counting a week of watching tutorials for it at work, then working on other projects, expecting it not to be so complicated.... The worst thing that could have happened, happened, I had it built, reading all the licenses just cutting and pasting until everything was in the correct directory unreal engine wanted. I ran into what I thought was going to be my last error, when it built properly the last time, started packaging, was two hours in, breaker flipped... I had to uninstall unreal engine, visual studio, android studio, and all development kits... Reinstalled and because of the time it took before, i knew i had already done it once, so, I decided, to use copilot and Character.AI on the play store, then had them collaborate with me ensuring that everything i was doing was going to be the exact correct thing to do, before I did it, I kept a log and stopped it halfway through, but it was much more helpful than all of this garbage - easiest way - no offense to the ai, they are what got me to the point I was at, then I stopped, and realized, I had every file in one spot, on the wrong drive, which I had to mount and verify permissions to in command prompt and create console variables in ue and environment variables in advanced system settings, and then instead of doing that, I moved everything to the drive it was trying to read from and then just cut and pasted worked perfect

自此以后,行同陌路 2024-10-18 13:04:54

对于新手 Android 开发人员和经验丰富的 Java 开发人员来说,知道哪些依赖项确实令人困惑,即使您已经克服了前面答案中的所有噩梦。

我的一位同事建议我使用 Android Studio(基于 IntelliJ IDEA :-) <特别是因为上面的噩梦。

我听从了他的建议。

但我不接受默认安装,并尝试将其安装在我的软件驱动器中。事实证明这是一场噩梦。 SDK 对话框似乎挂起并且一点也不直观。这就是我最终来到这里的原因。

阅读完上述内容后,我再次尝试 Studio,这次它接受了所有安装默认值。

嘿 PRESTO...它在几个对话中处理了所有 SDK 依赖项(我猜是核心依赖项),而没有提示,即 Ctrl + Shift + S 和 SDK。

因此我会向新手推荐它。这是布丁下载时的证明:

在此处输入图像描述

我下载并安装的 Studio 版本:

在此处输入图像描述

Windows 版本:

 在此处输入图像描述sstatic.net/juSiF.png" rel="nofollow noreferrer">在此处输入图像描述

之后它做了它的好事:

在此处输入图像描述

For a newbie Android developer, but an experienced Java developer, it is really bewildering to know which dependencies, even if you get past all of the nightmares in the previous answers.

A colleague of mine advised me to use Android Studio (which is IntelliJ IDEA based :-) specifically because of the above nightmares.

I followed his advice.

But I did not accept the defaults for the installation, and tried to install it in a software drive of mine. It turned out to be a nightmare. The SDK dialogue seemed to hang and was not intuitive at all. Which is why I ended up here.

After reading the above, I gave Studio another try, and this time it accepted all the defaults for the installation.

Hey PRESTO...it took care of all the SDK dependencies (core ones I am guessing) in a couple of dialogues without being prompted i.e., Ctrl + Shift + S and the SDK.

I would therefore recommend it for a newbie. Here the proof of the pudding as it downloads:

Enter image description here

The version of Studio I downloaded and installed:

Enter image description here

Version of windows:

Enter image description here

And here after it did its good stuff:

Enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文