简体   繁体   English

在 Mac 上安装 Android SDK

[英]Installing Android SDK on Mac

I'm extremly newish to Mac (now is the first time I see this operating system) and I'm trying to install the Android SDK on it.我对 Mac 非常陌生(现在是我第一次看到这个操作系统),我正在尝试在其上安装 Android SDK。

I've installed Android SDK before on Windows, but on Mac seems to be totally different, beginning with the fact that I don't have an installer.exe like on Windows which would tell me if I have a right JDK installed. I've installed Android SDK before on Windows, but on Mac seems to be totally different, beginning with the fact that I don't have an installer.exe like on Windows which would tell me if I have a right JDK installed.

  1. On Mac is needed to install a JDK to install? Mac上需要安装JDK才能安装? If yes, from where because in here there seems to be no mention of mac , only linux and windows .如果是,从哪里开始,因为这里似乎没有提到mac ,只有linuxwindows

  2. How can I verify if the right JDK is installed?如何验证是否安装了正确的 JDK?

Thank you, I know this is something silly to ask.谢谢,我知道问这个问题很傻。 but I really don't manage.但我真的不会。

After installing the SDK on a Mac running OS X Lion, I found the "android" command would not execute from the Terminal command line as shown in the instructions.在运行 OS X Lion 的 Mac 上安装 SDK 后,我发现无法从终端命令行执行“android”命令,如说明所示。 I found an alternate set of installation instructions that solve the problem...我找到了一套替代的安装说明来解决这个问题......

  • Download the Android SDK for Macintosh下载适用于 Macintosh 的 Android SDK
  • Extract it提取它
  • Download Fastboot for OSX (If not included with SDK)下载适用于 OSX 的 Fastboot(如果未包含在 SDK 中)
  • Extract fastboot and place it in your /tools folder.提取 fastboot 并将其放在 /tools 文件夹中。
  • Open up a terminal window打开一个终端 window
  • type: pico.bash_profile (this will create a.bash_profile)类型:pico.bash_profile(这将创建一个.bash_profile)
  • type the following in the new screen: export PATH=$ {PATH}:/tools在新屏幕中键入以下内容:export PATH=$ {PATH}:/tools
  • Hit CNTRL + X点击 CNTRL + X
  • Hit Y (for yes to save)点击 Y(是保存)
  • It will return you to the terminal screen… type: exit它会让你回到终端屏幕……输入:exit
  • Restart terminal.重启终端。
  • Then you can use your adb commands on the command line without adding "./"然后您可以在命令行上使用您的 adb 命令,而无需添加“./”

You don't need to install the JDK on Mac OS X. It is installed by default.您不需要在 Mac OS X 上安装 JDK。它是默认安装的。

By using the java -version command line utility you can verify that the right version of Java is installed.通过使用java -version命令行实用程序,您可以验证是否安装了正确版本的 Java。

Until recently Apple provided the JDK so there was no separate install.直到最近,Apple 才提供 JDK,因此没有单独安装。 Its still included in the current version of OS X but i think that changes with Lion.它仍然包含在当前版本的 OS X 中,但我认为 Lion 会改变。

Mac software most certainly can have installers (I see one every time I install an update to some software, notably Microsoft Office) but a lot of applications are packaged so that installation is just a matter of dragging from the .dmg file to the Applications folder. Mac 软件当然可以有安装程序(我每次安装某些软件的更新时都会看到一个,尤其是 Microsoft Office),但是很多应用程序都被打包,因此安装只需从.dmg文件拖到 Applications 文件夹即可.

That said, you'll almost certainly have the right version of Java already installed under your /System/Library folder.也就是说,您几乎肯定已经在/System/Library文件夹下安装了正确版本的 Java。 You can see what versions you have installed (you may have multiple ones) using the Java Preferences app that is in the /Applications/Utilities folder.您可以使用/Applications/Utilities文件夹中的Java Preferences应用程序查看已安装的版本(您可能有多个版本)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM