3

I have installed Xcode on my MacBook.

I checked that I have the XCode command line tool also installed as shown below:

enter image description here

I need to use Xcode command to install some dependencies, so I opened my terminal and run the command:

enter image description here

But I get Xcode: Command not found error. Why? How to get rid of this issue?

Leem.fin
  • 40,781
  • 83
  • 202
  • 354
  • What are you trying to accomplish exactly? `Xcode` isn't a command in itsel. Are you trying to install openssl, install zlib ? – Larme Aug 10 '20 at 08:28
  • 1
    Yes, I understand Xcode is for iOS development. But Xcode also have command line tool . I need to install openssl zlib readline through Xcode command that is a requirement for another tool I am using. https://github.com/aws/aws-elastic-beanstalk-cli-setup#11-prerequisites – Leem.fin Aug 10 '20 at 08:30
  • " need to install openssl zlib readline through Xcode" That's unclear here. Where did you find this doc? – Larme Aug 10 '20 at 08:31
  • Please see my link in my command. It asks me to use Xcode command to install those tools. – Leem.fin Aug 10 '20 at 08:31
  • 2
    In fact, you need to install `openssl`, `zlib`, `readline` on the machine. That command is misleading. Check each one how to install them with Mac. `HomeBrew` (`brew`) might be of help. Which make MORE SENSE. See https://github.com/aws/aws-elastic-beanstalk-cli-setup/pull/89 https://github.com/aws/aws-elastic-beanstalk-cli-setup/pull/89/commits/71df7e7e9a228489a3b7431bd832f4c2b2ce9441 (author chose `brew` solution). – Larme Aug 10 '20 at 08:35
  • @Larme I don't think it is misleading. Because I have already tried that installing them using `brew` command, it doesn't work for the aws-beanstal-cli installation, I have to use Xcode command line like the linked instruction said. It is the prerequisites, which I missed. If you try it , you know what I mean. Anyway, it is beyond the scope of my question. My question is merely how to make that `Xcode` command working on my terminal. – Leem.fin Aug 10 '20 at 08:36
  • "I have already tried that installing them without Xcode command" Well, it won't work, because "Xcode command": That doesn't exist. You get "Xcode: command not found", that's normal, and you won't get anything else. Did you get the tools installed correctly? Didn't you get any errors in the logs after installation attempts, like https://github.com/aws/aws-elastic-beanstalk-cli-setup/pull/64 etc.? Can you check that they are correctly installed and set? – Larme Aug 10 '20 at 08:39
  • Yes and yes. I tried, I checked, I don't see anything wrong. That's why I ended up posting this question since even my terminal told me I installed all those dependencies succesfully and correctly using `brew` when checking them. – Leem.fin Aug 10 '20 at 08:40
  • https://apple.stackexchange.com/questions/284379/with-homebrew-how-to-check-if-a-software-package-is-installed check the links too https://superuser.com/questions/874617/how-do-i-find-out-where-brew-links-end-up etc. – Larme Aug 10 '20 at 08:40
  • Thanks, but please see my previous comment. I checked. All good. That's why this question posted here. – Leem.fin Aug 10 '20 at 08:41
  • So, if there is no `Xcode` command existing like you said, what is that XCode command line tool in xcode (indicated in my screenshot)? – Leem.fin Aug 10 '20 at 08:42
  • Did you check the later doc: `Most installation problems on macOS are related to loading and linking OpenSSL and zlib. The following command installs the necessary packages and tells the Python installer where to find them: $>brew install zlib openssl readline CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="..." Run brew info to get the latest environment variable export suggestions, such as brew info zlib where it fixed the command and add other flags? – Larme Aug 10 '20 at 08:43
  • It's an error, that's what I'm saying from the start. That's why an user stated it was wrong and used a PR for the fix. That's why later in the documentation there is not more the `Xcode openssl etc.`, but `brew openssl etc.` – Larme Aug 10 '20 at 08:44
  • @Larme I really have already tried all what you mentioend, I actually have spend two days trying to get the aws-elastic-beanstalk installation work. – Leem.fin Aug 10 '20 at 08:44
  • Why it is an error? Have you seen my screenshot in my question? There is a `XCode command line tool` thing right in the screenshot which is from Xcode. Please open your Xcode --> Preference -->Locations--> Command Line Tools . I mean what is that tool from Xcode? It could be for legacy reason that to make the aws-elastic-beanstalk installation work I have to use legacy `XCode` command line. Because I already tried all the things with brew. Now the only thing I haven't tried is the XCode command . and there is a command line from XCode & it is a suggestion from Amazon Web Service. – Leem.fin Aug 10 '20 at 08:45
  • No. Usually, the command line tools is packaged with Xcode. That's why we usually download/install the whole Xcode to have the command line tools. It's easier. You can get only the line tools if wanted: https://developer.apple.com/download/more/ Since we can have multiple version of Xcode, and then multiple command line tools, there is this option to guarantee that (it's an `xcode-select` command behind it). BUT, if you have any issue, why not opening a ticket on their GitHub? And how do you know it's not working? On which step are you having the issue (beside that Xcode command?) Error? – Larme Aug 10 '20 at 08:51
  • Also, did you do the build_installer: https://github.com/aws/aws-elastic-beanstalk-cli-setup/pull/85/commits/d187fc3bf13d7c47eb8dcc060a560868bab833cd ? Step that seems to be needed/mixed with the next step. – Larme Aug 10 '20 at 08:57
  • The command to install the elastic beanstalk-cli always fail complaining the zlib, though I successfully installed it with `brew` and yes, I checked it is successfully installed. Then I realized the prerequisites to use `Xcode openssl zlib readline` to install the dependencies. Then I ended up with this Xcode command not found error. That's the whole story. – Leem.fin Aug 10 '20 at 08:59
  • Well, in my opinion, the doc has an issue at the start, for all the reason states (invalid command, it's fixed later, there is a opened pr with the fix waiting for review, etc.) I don't know if the flag command has been correctly set by you (`CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib"` command line being important), which could be why it's complaining about zlib. – Larme Aug 10 '20 at 09:04
  • If that flag command is from that `Troubleshooting` section, then, yes, I did that as well. But thanks for your help! – Leem.fin Aug 10 '20 at 09:08

1 Answers1

3

Okk, if you're trying to install the AWS ELastic beanstalk CLI (you're coming from EB CLI Installer on Github here)

then the line Xcode openssl zlib readline refers to all the packages that are prerequisites to the installation and not a command that you should run.

In short use:

brew install openssl
brew install zlib
brew install readline

And make sure Xcode is installed through which g++ if you get /usr/bin/g++ you're all set and you can proceed to the following steps

mrateb
  • 2,317
  • 5
  • 27
  • 56