How to open the AVD manager on OSX from iTerm2? - macos

I am using Homebrew to install Android dev tools
brew install gradle
brew install android-sdk
Then I am getting command not found when running avdmanager.
➜ ~ avdmanager
zsh: command not found: avdmanager
How to open the AVD manager on OSX from the command line?

Environment variables missing maybe?
Considering the SDK is installed under /Users/<your_user>/Library/Android/sdk folder which is the Android Studio preferred SDK location, but it works fine under /usr/local/share/android-sdk as well, which is a location pretty much used on CI mostly.
Add the following either on the .zshrc file. ( or .bash_profile on iTerm )
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
On the terminal
➜ ~ source .zshrc
It outputs
➜ ~ sdkmanager --version
26.1.1
See https://developer.android.com/studio/command-line/variables

Related

How to get VScode terminal to use packages installed on Mac terminal via composer

I installed composer using home brew on my Utilities terminal on my Mac.
When I try to use packages installed through composer, I get that it isn't installed. For example, I can run laravel new appname in the Mac terminal, but it won't let me run it in VScode terminal (using zsh). I get the error zsh: command not found: laravel.
Can someone help so that the VScode terminal uses the packages installed in my Mac terminal?
My /etc/paths file looks like this:
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Users/melaniecarr/.composer/vendor/bin
You need to add the relevant directories to your PATH in ~/.zshenv. Try which laravel in the shell that works to see what directories you need to add. E.g.:
❯ which watch
/usr/local/bin/watch
❯ export PATH="/usr/local/bin:$PATH" # needs to be in ~/.zshenv to be permanent

zsh: command not found: heruko - How to get up and running with Heroku CLI on Mac Catalina?

With brew I have downloaded and installed Heroku CLI.
But when I open a Terminal and type heruko, I get this response:
% heruko
zsh: command not found: heruko'
I followed the instructions on devcenter.heroku.com
macOS:
$ brew tap heroku/brew && brew install heroku
https://devcenter.heroku.com/articles/heroku-cli
Apperently the install has been succesful, because when I try to run it again I get the message:
Warning: heroku/brew/heroku 7.42.4 is already installed and up-to-date
To reinstall 7.42.4, run `brew reinstall heroku`
Should some path variable be added to the .zshrc file?
I already have some path variables to other stuff in my .zshrc file, this is how it looks now:
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH="$PATH:/Users/a/Documents/downloaded-tools/flutter/bin"
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
Shall there be added an entry about Heroku CLI, there?
If so, exactly what should be added?
I am running a Mac Book Pro 2019 16" - Catalina

Cannot get spark/pyspark working on macOS Mojave

Have a new MacBook w/ macOS Mojave but cannot get spark/pyspark working. I have done the following:
Downloaded the latest Apache Spark from https://spark.apache.org/downloads.html
Unzipped it in my home directory (/Users/myname/)
Renamed the folder spark
Checked in the Finder window that spark was there, and the folder contained python, bin, and bin/spark-shell subfolders
Got the ability to pip install packages with: curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py >> python get-pip.py in the terminal >> Checked that it was installed by doing import pip in the python shell >> sudo easy_install pip in the regular terminal
pip install pyspark, which worked
Created both a .bashrc and .bash_profile files in the Users/myname/ path
I tried the following versions of the commands in these bash files:
export SPARK_HOME="/Users/myname/spark/python"
export PATH="$SPARK_HOME/bin:$PATH"
export SPARK_HOME=/Users/myname/spark/python
export PATH=$SPARK_HOME/bin:$PATH
export SPARK_HOME=/Users/myname/spark
export PATH=$SPARK_HOME/bin:$PATH
export SPARK_HOME=~/spark
export PATH=$SPARK_HOME/bin:$PATH
Different installation articles say I should just be able to do pyspark in the terminal, or spark/bin/spark-shell or just 'bin/spark-shell`, I just keep getting versions of the message
-bash: pyspark: command not found
Any advice?
If you've installed pyspark from pip, you don't need the standalone installation. You just need to fix you env vars. First, find the location of your site packages:
python -c "import site; print(site.getsitepackages())"
This is probably something like this /usr/lib/pythonX.Y/site-packages
Then, add the exports to your bash profile and source it.
echo "export SPARK_HOME=/usr/lib/pythonX.Y/site-packages/pyspark" >> ~/.bash_profile
echo "export PATH=$SPARK_HOME/bin:$PATH" >> ~/.bash_profile
source ~/.bash_profile

Failed to localise android-ndk installed from homebrew

I have installed SDK doing brew cask install android-ndk and NDK doing brew cask install android-ndk, everything was ok during the installation and inserted the PATH, like this:
export GRADLE_HOME=/usr/local/opt/gradle
export ANDROID_HOME=/usr/local/Caskroom/android-sdk/3859397
export ANDROID_NDK_HOME=/usr/local/Caskroom/android-ndk/16b/android-ndk-r16b
export ANDROID_SDK_ROOT=/usr/local/Caskroom/android-sdk/3859397
export PATH=$GRADLE_HOME/bin:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
Saved and committed doing source ~/.bash_profile.
After, I tried to run my gradle task, during start of compile of a C++ library, I got this:
* What went wrong:
A problem occurred configuring project ':some-library'.
> NDK not configured.
Download it with SDK manager.
Is there any way to solve it?
Thank you.
In macOS installed with brew use this the following paths
In file ~/.bash_profile
export ANDROID_NDK_HOME = /usr/local/share/android-ndk
export ANDROID_HOME = /usr/local/share/android-sdk
If you are using another bash script or zsh for example, you should put it begin of that script file, eg.
myortherscript.sh
#!/bin/bash
# THIS AT TOP
source ~/.bash_profile
Important: This sample I'm considering the same user for configuration bash_profile and script execution.

unable to setup ssldump on mac using homebrew

I just installed ssldump on a mac computeg using brew. The installation process ran without reporting any issues (ssldump-0.9b3 already installed). However, when I try running ssldump from the same prompt or a new terminal window, the error message I get is:
-bash: ssldump: command not found
Is there anything else that i need to do to make this work on a Mac El capitan (v10.11.6)?
Simply using brew install ssldump did not work for me as ssldump was added in /usr/local/sbin (which was neither mentioned on /etc/paths nor in .bash_profile). I ended up adding /usr/local/sbin to the .bash_profile and used sourced the file to enable the change.
cd ~
sudo vi .bash_profile
add to the file:
export PATH=/usr/local/sbin:$PATH
&
source .bash_profile

Resources