Cannot find adb under platform-tools - android

I have installed android-sdk through command line
command - brew install --cask android-sdk
and have also installed the platform tools. I have this folder structure
/usr/local/share/android-sdk
under this, i have the following:
emulator
licenses
patcher
platform-tools
platforms
system-images
tools
there is no adb inside platform tools, in fact it is empty. I do have adb installed which is under: /usr/local/bin/adb
Now , when I build - I keep getting the error :
An unknown server-side error occurred while processing the command. Original error:
Could not find 'adb' in ["/usr/local/share/android-sdk/platform-tools/adb","/usr/local/share/android-sdk/emulator/adb",
"/usr/local/share/android-sdk/cmdline-tools/latest/bin/adb","/usr/local/share/android-sdk/tools/adb",
"/usr/local/share/android-sdk/tools/bin/adb",
"/usr/local/share/android-sdk/adb"]. Do you have Android Build Tools installed at '/usr/local/share/android-sdk'?
Can anyone help me to solve this?

Use brew install --cask android-platform-tools

Related

brew install stuck for hours

My brew install stuck at "/usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress"
I kept laptop on for almost a day but its not moving forward
This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The Xcode Command Line Tools will be installed.
Press RETURN to continue or any other key to abort:
==> /usr/bin/sudo /usr/sbin/chown -R ab:admin /usr/local/Homebrew
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
""Stuck here""
I just run into this issue, for me it is basically because Xcode command line tools cannot be installed (brew has a dependency on xcode commandline tools so it will try to install it if it is missing).
The workaround I get is downloading the xcode commandline tool form https://developer.apple.com/download/all/ and install it manually. Then running brew installer should be fine.
To install Xcode Command Line Tools, you can also just enter xcode-select --install at a Terminal prompt, and that will trigger a built-in online installation process.

Genymotion not able to find SDK location

I install android-sdk through brew cask install android-sdk. its been downloaded in /usr/local/share/android-sdk location. However, when I am trying to set this path to Genymotion's ADB setting. it says android sdk not found.
folder inside android-sdk
Genymotion looks for two binaries provided by the Android SDK: adb and aapt.
It looks for adb in:
$sdkPath/platform-tools
$sdkPath/tools
$sdkPath
And for aapt in:
$sdkPath/build-tools/*/
$sdkPath/platform-tools
$sdkPath/platforms/*/tools
$sdkPath/tools
$sdkPath
You should check if those are installed in /usr/local/share/android-sdk.

brew cask install android-sdk

I’m having problem to install android sdk (brew cask install android-idk) on Mac OS X.
I tried to install it for nativescript. I read on people that had the same problem but i couldn't find working solution.
I tried to change the java path maybe it cause the issue.
this is the error I get:
==> Caveats
We will install android-sdk-tools, platform-tools, and build-tools for you.
You can control android sdk packages via the sdkmanager command.
You may want to add to your profile:
'export ANDROID_SDK_ROOT=/usr/local/share/android-sdk'
This operation may take up to 10 minutes depending on your internet connection.
Please, be patient.
==> Satisfying dependencies
==> Downloading https://dl.google.com/android/repository/sdk-tools-darwin-3859397.zip
Already downloaded: /Users/jhon/Library/Caches/Homebrew/Cask/android-sdk--3859397,26.0.1.zip
==> Verifying checksum for Cask android-sdk
==> Installing Cask android-sdk
==> Warning: Failed to download any source lists!
==> Warning: java.nio.file.NoSuchFileException: /Users/jhon/.android/cache/sdkbin-1_b735609c-repository2-1_xml
==> Warning: Failed to find package tools
Error: Command failed to execute!
==> Failed command:
/usr/local/Caskroom/android-sdk/3859397,26.0.1/tools/bin/sdkmanager tools platform-tools build-tools;26.0.1
==> Standard Output of failed command:
==> Standard Error of failed command:
jhon-MacBook-Pro-8:appNativescript jhon$ brew cask install android-idk --verbose --debug
Error: Cask 'android-idk' is unavailable: No Cask with this name exists.
Error: Install incomplete.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/install.rb:13:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb:35:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:97:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:167:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:131:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:8:in `cask'
jhon-MacBook-Pro-8:appNativescript jhon$ brew cask install android-sdk
==> Caveats
We will install android-sdk-tools, platform-tools, and build-tools for you.
You can control android sdk packages via the sdkmanager command.
You may want to add to your profile:
'export ANDROID_SDK_ROOT=/usr/local/share/android-sdk'
This operation may take up to 10 minutes depending on your internet connection.
Please, be patient.
==> Satisfying dependencies
==> Downloading https://dl.google.com/android/repository/sdk-tools-darwin-3859397.zip
Already downloaded: /Users/jhon/Library/Caches/Homebrew/Cask/android-sdk--3859397,26.0.1.zip
==> Verifying checksum for Cask android-sdk
==> Installing Cask android-sdk
==> Warning: Failed to download any source lists!
==> Warning: java.nio.file.NoSuchFileException: /Users/jhon/.android/cache/sdkbin-1_b735609c-repository2-1_xml
==> Warning: Failed to find package tools
Error: Command failed to execute!
==> Failed command:
/usr/local/Caskroom/android-sdk/3859397,26.0.1/tools/bin/sdkmanager tools platform-tools build-tools;26.0.1
==> Standard Output of failed command:
==> Standard Error of failed command:
Warning: Failed to download any source lists!
Warning: java.nio.file.NoSuchFileException: /Users/jhon/.android/cache/sdkbin-1_b735609c-repository2-1_xml
Warning: Failed to find package tools
==> Exit status of failed command:
#<Process::Status: pid 35477 exit 1>
Error: Install incomplete.
jhon-MacBook-Pro-8:appNatives
This is what docs say and you can give it a try -
Solution 1 -
Install the dependencies for Android development.
Install JDK 8 or a later stable official release.
Go to Java SE Downloads and click Download for JDK.
In the Java SE Development Kit section, accept the license agreement and click the download link for Mac macOS.
Wait for the download to complete and install the JDK.
Set the JAVA_HOME system environment variable.
export JAVA_HOME=$(/usr/libexec/java_home)
Install the Android SDK.
Run the following commands in the Terminal:
brew cask install android-sdk
Next, run the following command to set the ANDROID_HOME system environment variable:
export ANDROID_HOME=/usr/local/share/android-sdk
NOTE: This is the directory that contains the tools and platform-tools directories.
In addition, install all packages for the Android SDK Platform 25, Android SDK Build-Tools 25.0.2 or later, Android Support Repository, Google Repository and any other SDKs that you may need. You can alternatively use the following command, which will install all required packages.
$ANDROID_HOME/tools/bin/sdkmanager
"tools" "platform-tools" "platforms;android-25" "build-tools;25.0.2" "extras;android;m2repository" "extras;google;m2repository"
Setup Android Emulators (AVD) by following the article here
OR
Solution 2
Download Android Studio and update for API levels and support repos that's it - Works all the time for me
Android SDK

How to install android SDK tools without installing Android studio on ubuntu?

I was trying to install Android SDK with the help of the SDK command line tools downloaded from the link https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip on my Linux Ubuntu 16.04 PC.
i run the command following command for installation
./android update sdk
sudo ./android update sdk
but getting the this
error
how to solve this error ?or suggest me a proper way to install build tools.
FYI
and also i read that ~/.android should contain androidtool.cfg file which has below data in it.
http.proxyPort=proper_port
http.proxyHost=Proper_proxy_ip
sdkman.show.update.only=true
sdkman.ask.adb.restart=false
sdkman.force.http=true
It says that android script is deprecated, so you must use $ANDROID_HOME/tools/bin/sdkmanager --update for update all the installed packages, and $ANDROID_HOME/tools/bin/sdkmanager --list for see a list of installed, updates and available packages.
See more options at: https://developer.android.com/studio/command-line/sdkmanager.html or with $ANDROID_HOME/tools/bin/sdkmanager --help
$ANDROID_HOME refer to the location of your Android SDK. by example:
export ANDROID_HOME=$HOME/android/sdk

Android Studio Won't Use Brew Cask Android-SDK Directory

We try to maintain scripts to rapidly onboard new developers and maintain consistency across teams/members. We used to install the Android SDK and NDK tools via command line as part of our scripts, download all the platforms we need and tools, and then setup android studio to use them. Since the release of Android 26 this doesn't seem possible and Android wants it to all be done via Studio. Is there any reason why the below scenario would not work?
Mac OSX
Android Studio: 2.3.3 - Installed via brew cask install android-studio (Homebrew)
Android-SDK 26: Installed via brew cask install android-sdk
Android rc file (sourced in bash_profile)
export ANDROID_SDK_ROOT=/usr/local/share/android-sdk
export ANDROID_HOME=/usr/local/share/android-sdk/
export ANDROID_NDK_HOME=/usr/local/share/android-ndk
Steps to reproduce:
Install above dependencies using homebrew cask.
Update environment variables (export them in bash profile or the like).
Open android studio - It should prompt to install the SDK.
Attempt to use the share sdk (android sdk root path above).
Android Studio says sdks is not valid nor empty.
Try running sdkmanager "platforms;android-26". This is because the basic tools are not installed to be recognised as a valid SDK directory.
To make Android Studio happy with brew I had to "brew" this:
brew cask install android-sdk
brew cask install android-platform-tools
sdkmanager "platforms;android-27"
sdkmanager "build-tools;27.0.3"
sdkmanager "extras;android;m2repository"
sdkmanager "extras;google;m2repository"
sdkmanager "sources;android-27"
and my ANDROID_HOME is:
/usr/local/share/android-sdk
For osx and the new Android Studio (2.3.3 at this time) the sdk is now in ~/Library/Android/platforms and the tools are in ~/Library/Android/platform-tools so add those to our path instead of using brew.

Categories

Resources