After set up Appium will pop not find out aapt - appium

I'm trying set up me Appium Automatic Server ,after setup done tap start session botten will show bellow error messages.
An unknown server-side error occurred while processing the command.
Original error: Could not find 'aapt' in PATH. Please set the
ANDROID_HOME environment variable with the Android SDK root directory
path.
after I follow change , but doesn't work
export ANDROID_HOME=$HOME/Library/Android/sdk
export JAVA_HOHE="$(/usr/libexec/java_home -v 1.8)"
export ANDROID_HOME=/home/hauying/Library/Andriod/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/build-tools/29.0.1:$PATH
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platfrom-tools
export PATH=$PATH:/Applications/apache-maven-3.6.0/bin

Please update your bash_profile to access adb from the terminal
on PC open terminal,
A good way to edit the file is to use nano or vi. You can use the command sudo nano ~/.bash_profile, and enter your admin password when prompted, then add the below line to the end and save the file. Make sure you chnage according to your file path on your machine
export ANDROID_HOME=/Users/krishnachetan/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/build-tools/28.0.3:$PATH
To activate the changes in the current shell, you have to "source" the updated bash_profile file. You do this with the command:
$ source ~/.bash_profile
This simply imports the file's settings into the current shell. Now every time you open your shell, your bash_profile will automatically be "sourced" and you won't need to run this command every time.

Related

PIPX Install on MAC - Duplicate user/xxx/.local/bin in PATH

I have recently installed PIPX on MAC running Big Sur and ZSH shell. During the install it prompted for the following to be added to the .zshrc file....
# Created by `pipx` on 2021-03-20 14:22:23
export PATH="$PATH:/Users/xxxx/.local/bin"
eval "$(register-python-argcomplete pipx)"
Running echo $PATH showed /Users/xxxx/.local/bin added to the end of my PATH variable. However, when I close the terminal and open up a new session, running echo $PATH now shows the location duplicated at the end of the PATH :/Users/xxxx/.local/bin:/Users/xxxx/.local/bin
Opening and closing new terminal sessions doesn't seem to create any more additions to PATH it just remains at these 2 entries....
I have run typeset -U PATH path to remove the duplicate but each time I open up new terminal sessions it just duplicates again.
Does anybody know how I can stop this from happening.....I would really like to keep my PATH variable as clean as possible.
Add the following path to your .zshrc file :
export PATH="${PATH}:$(python3 -c 'import site; print(site.USER_BASE)')/bin"
Reference: [command not found: pipx]: https://github.com/pipxproject/pipx/issues/283

Where to set the GOOGLE_APPLICATION_CREDENTIALS environment variable?

I am trying to use Python to call a Google Cloud AI platform training API. The path to my service account key JSON file is "/Users/my_mac_username/service_account_key.json", and I added the export statement in the bash_profile file so that it looks like:
# Setting PATH for Python 3.8
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:${PATH}"
export PATH
export GOOGLE_APPLICATION_CREDENTIALS="/Users/my_mac_username/service_account_key.json"
However, I still got the error:
google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials.
Besides, I have google-cloud-sdk folder installed. I would like to know in which file I should set the environment variable. Thanks for your help!
Assuming your terminal shell is bash, you have your environment variable setup correctly. The new variable will not be available until you reopen the terminal or run source ~/.bash_profile in the current terminal.
If you are running zsh, add the export in your ~/.zshrc file.
To determine which shell you're currently running, use: echo $SHELL from the command line

Getting error "command not found: fastlane"

I have tried following few tutorials but getting the same error every time.
I tried installing using bundle methods:
bundle init (in project repository)
I added gem "fastlane" in Gemfile and then used bundle install to install fastlane.
But when I fastlane init raises an error zsh: command not found: fastlane
following tutorial =
Try
export PATH="$HOME/.fastlane/bin:$PATH" in your shell.
If it works, add it to the .zshrc to make it permanent.
source .zshrc again in the same session or restart the shell (e.g., restart the terminal).
============= EDIT =============
Substitute export PATH="$HOME/.fastlane/bin:$PATH" with export PATH="/usr/local/bin/fastlane" if ~/.fastlane does not exist and /usr/local/bin/fastlane does.
If cd ~/.fastlane works, proceed with $HOME/.fastlane/bin, and if it doesn't & ls /usr/local/bin | grep fastlane finds fastlane, substitute with /usr/local/bin/fastlane.
The export PATH="$HOME/.fastlane/bin:$PATH" part should be typed directly into the shell command line, i.e., the console you typed bundle init in.
If this solves your problem, then add the line export PATH="$HOME/.fastlane/bin:$PATH" to the end of your .zshrc file. This file can be found in your home directory ~.
In the terminal, cd ~ and list all the files in the directory by ls -al. If you see .zshrc, open it with an editor of your choice, e.g., nano if you are new to command line tools, vim, pico, etc.
At the end of the file, add
export PATH="$HOME/.fastlane/bin:$PATH"
If .zshrc does not exist, create one under your home directory and add the above line (Then your single-line .zshrc will only contain the above command.).

Couldn't detect shell config file (zsh - ~/.zshrc)

I have no idea what I am doing here, I am trying to install fastlane via terminal, but I keep getting this error:
Couldn't detect shell config file (zsh - ~/.zshrc) Please add the
following line to your zsh profile: export
PATH="$HOME/.fastlane/bin:$PATH"
My question is how do I locate and add this line to my zsh profile?
I have absolutely no idea what I am doing here.
You should add this line in your bash profile :
export PATH="$HOME/.fastlane/bin:$PATH"
There are (mainly) two user level files which bash may run when a bash shell starts.
~/.bash_profile or ~/.bashrc.
And its depend your OS.

Extend $PATH variable in git bash under Windows

I'm trying to extend my $PATH variable in git bash (MinGW shell) by adding the following to the file ~/.bashrc
PATH=$PATH':/c/Program Files/maven/apache-maven-3.2.5/bin'
After I did this and restarted the bash it seems like that the $PATH variable was extended like expected:
$ echo $PATH
MANY_OTHER_PATHS:/c/Program Files/maven/apache-maven-3.2.5/bin
But I still cannot execute the programms in the given directory:
$ mvn
bash: mvn: command not found
What went wrong here? How do I extend the PATH variable correctly?
Here are two ideas.
You can have your path with double quote mark.
export PATH=$PATH:"/C/Program Files (x86)/apache-maven-3.3.3/bin"
Or, You can also make symbolic link for the directory.
ln -s "/C/Program Files (x86)/apache-maven-3.3.3/bin" ./mvnbin
export PATH=$PATH:/your-path/mvnbin
It works for me in mingw32 environment.
I needed to add something to my Git Bash path permanently each time I open it. It was Meld.exe path which can be added with:
export PATH=$PATH:"/C/Program Files (x86)/Meld/lib"
In order to execute this command each bash session, you need a ~/.bashrc file. Check if it already exists or create it using notepad ~/.bashrc or touch ~/.bashrc.
You can check where it is with:
echo ~
Open it and add the command that adds the PATH (first command in this response).
I hope you found this useful.
According to this SO post, you need to escape Program Files with quotes. git-bash $PATH cannot parse windows directory with space
Add PATH in Git Bash Permanently | Windows Only
Just in case you are still wondering how to add a path permanently in git bash here is the step-by-step process for Windows users:
Create .bashrc in user's root folder using the below command. It will open notepad and ask you to create the file, click yes.
notepad ~/.bashrc
Put the directory you want to add as below, for more than 1 items repeat the same format in next line:
export PATH=$PATH:"/c/folder/folder/"
Save the file and relaunch the bash.
Next launch will give you a warning like WARNING: Found ~/.bashrc but no ~/.bash_profile, ~/.bash_login or ~/.profile. but git bash will handle it by creating the required files.
SOME INSIGHTS
Git Bash doesn't fetch Window's environment PATH, it maintains its PATH separately in more like a Linux way.
You can run export PATH=$PATH:"/c/folder/folder/" in cmd to add a directory to path, but it will be only for the current session once you close the bash, it will be gone.
.bashrc is a shell script file that will be executed every time you launch a new git bash window. So you can add any type of bash command here. We simply added the export command to add our desired directory to PATH.

Resources