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.
Related
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
When installing android sdk using home-brew I get this message
android-sdk has been officially discontinued upstream.
But I can't find an alternative package to use. Is there a different one I should be using?
If you don't want the full android-studio development app (Intellij IDE, etc) and just want the new command line tools...
Per the discontinuation notice...
This SDK Tools package is deprecated and no longer receiving updates. Instead, please use the new command-line tools package.
A quick search reveals that in homebrew land, this new "command-line tools" package is called android-commandlinetools.
$ brew remove android-sdk
$ brew install --cask android-commandlinetools
If you are looking for adb and such, these are "SDK Platform Tools" and can be installed using sdkmanager (which was installed by the new android-commandlinetools package)...
$ sdkmanager --install platform-tools
Depending on where sdkmanager installs platform-tools you might need to update your $PATH or add symlinks in order to run adb and other platform-tools without an absolute path.
...or if you just want adb/etc you can skip the full commandlinetools and install platform-tools directly with homebrew. This has the side benefit of ensuring the newly installed adb is within your $PATH and is probably the best option for people that aren't doing android development and just want the latest adb, fastboot, etc.
$ brew install --cask android-platform-tools
Per https://developer.android.com/studio/releases/sdk-tools
Note: This SDK Tools package is deprecated and no longer receiving updates. Instead, please use the new command-line tools package.
check out https://developer.android.com/studio
brew install android-studio
I'm trying to install just the Android Emulator on my Mac, not the whole Android Studio.
So far I have:
1) Installed Android-SDK via Homebrew
brew cask install android-sdk
2) Added to my $PATH, and checked I have no other ANDROID related PATHS going on.
export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"
3) In terminal running
$ANDROID_SDK_ROOT
shows
/usr/local/share/android-sdk: is a directory
4) Created a new AVD in with AVDManager.
5) Try to run created AVD and get this error
PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [/usr/local/share/android-sdk]!
I also can't run 'emulator' from the command line, I CAN run avdmanager and sdkmanager fine.
I've checked the path which appears to be correct. The AVD is in the location of
/Users/<user>/.android/avd/test.avd
Where could I be going wrong?
I had the same issue on Linux, trying to build a Docker image for the emulator, and finally find out what the reason was by looking at the Android emulator source code.
I installed only the required SDK packages for emulator ("emulator" and one of the "system-images"), but the emulator program check if ANDROID_HOME or ANDROID_SDK_ROOT path contains the "platforms" and "platform-tools" directory, so I installed the "platform-tools" package and one of the "platforms" package and it worked.
Manually create those two empty directories should also be enough.
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.
I'm working on a macbook and developing with cordova. Now, I want to create an Android apk, but, when I type cordova platform add android I get this:
Error: The command "android" failed. Make sure you have the latest Android SDK installed, and the "android" command (inside the tools/ folder) is added to your path.
Ok, this message should be very clear about what to do next, but don't know what to do. When I search I keep getting how to solve this in Windows and can't follow steps.
What (and how) should I do?
Thanks
EDIT:
I've already installed Android SDK when trying to compile apk.
More info:
As I couldn't install ANT, I uninstalled it: brew uninstall ant. But when brew install antagain I got:
$ brew install ant
==> Downloading http://www.apache.org/dyn/closer.cgi?path=ant/binaries/apache-ant-1.9.3-bin.tar.gz
==> Best Mirror http://apache.rediris.es/ant/binaries/apache-ant-1.9.3-bin.tar.gz
curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "ant"
Download failed: http://apache.rediris.es/ant/binaries/apache-ant-1.9.3-bin.tar.gz
Some things to make sure you have completed before starting w/ Android:
Make sure ANT is installed:
Try ant --version, if command not found you need to install ANT.
The easiest way I have found is to use Homebrew. If you do not have homebrew installed, get it here
Once installed run
homebrew update
homebrew install ant
Unpack Android SDK:
Download and unpack the SDK package, place it in an easy to find location.
Then add the tools and platform-tools paths to your global PATH, like this:
vi ~/.bash_profile
add this line:
export PATH=/path/to/android/sdk/tools:/path/to/adnroid/sdk/platform-tools:$PATH
Exit the terminal and re open the terminal.
Now you should be able to run cordova platform add android in your project folder.