Skip to content

Instantly share code, notes, and snippets.

Last active July 28, 2023 06:57
  • Star 56 You must be signed in to star a gist
  • Fork 20 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Erichain/0ac3a6aaca0c28ad6551 to your computer and use it in GitHub Desktop.
Mac OS下安装和配置android-sdk

##MAC OS下安装和配置android-sdk



brew update

brew install android-sdk

如果遇到无法通过代理下载安装包的情况时,可以先手动下载安装包, 然后,将安装包放到homebrew的缓存里,

$ cp <path to download file> $(brew --cache android-sdk)


$ brew install android-sdk




export ANDROID_HOME="/usr/local/opt/android-sdk"

然后source ~/.zshrc使其生效


运行android命令,调出Android SDK Manager,安装下面这些选项:

  • Tools

    • Android SDK Tools
    • Android SDK Platform-tools
    • Android SDK Build-tools
  • Android 5.1.1 (API 22)

    • SDK Platform
    • Intel x86 Atom_64 System Image
  • Extras

    • Android Suport Library
    • Intel x86 Emulator Accelerator(HAXM Installer)



$ cd /usr/local/Cellar/android-sdk/24.4.1_1/extras/intel/Hardware_Accelerated_Execution_Manager/


$ ./HAXM\ installation




$ android avd

  • 打开Android Virtual Device Manager

  • 选择Device Definitions一项

  • 选择需要的模拟器类型,点击Create AVD

创建完成AVD之后,回到Android Virtual Devices选项卡,选择创建好的模拟器,点击Start就可以启动模拟器了。

Copy link

EXSVAMP commented Jun 19, 2017

brew 命令 修改为 brew cask install android-sdk

Copy link

brew 命令 修改为 brew cask install android-sdk

然后.bash_prodile就要改成export ANDROID_HOME=/usr/local/share/android-sdk

Copy link

garasmc commented Dec 21, 2019

android 无法启动 Android SDK Manager 的 GUI 进行安装的

可使用 tools/bin/sdkmanager --list 列出所有可用包,用命令行手动安装

Copy link

我用brew cask install android-sdk 安装完毕之后,./zsh里面会自动添加Android_Home。用Finder在对应的路径下也能找到,但是Android_studio识别不出来!所以,我只能用brew cask uninstall android-sdk卸载后,用Android Studio下载一边,下载到/Users/用户名/Library/Android/sdk 这个目录里面(用户名是你本机的用户名,例如lisa)

Copy link

说 android studio 太大的,电脑是有多小啊

Copy link

miozus commented Apr 26, 2021

❯ ./sdkmanager
Error: Could not determine SDK root.
Error: Either specify it explicitly with --sdk_root= or move this package into its expected location: <sdk>/cmdline-tools/latest/

~/opt/cmdline-tools/bin 43s
❯ ./sdkmanager --sdk_root=$HOME/Library/Android/sdk

Warning: Failed to download any source lists!
Warning: Still waiting for package manifests to be fetched remotely.
Warning: IO exception while downloading manifest
Warning: Still waiting for package manifests to be fetched remotely.
[=======================================] 100% Computing updates...

.zshrc设置空文件变量仍然报错, 官网放弃命令行更新,各种不友好的文档引导, 下载界面藏底部, 各种逼你装IDE, 网上文档也很少安装成功的(都过时没用),

到底不能干净的安装 Flutter 的安卓环境, 所以我哭了, 把卸载的 IDE 又安装起来. 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment