- Android Debug Bridge (ADB)
- Android Virtual Device (AVD)
- OpenJDK (v8)
- Linux
- Tools -> SDK Manager
- Tab: SDK Tools
- Check "Show Package Details"
- Expand "Android SDK Command-line Tools (latest)"
- Check "Android SDK Command-line Tools (latest)"
- Click: Apply
# Using Homebrew
brew install --cask android-commandlinetools
# Using Chocolatey
choco install -y android-sdk
For Bash or Zsh, put something like this in your $HOME/.bashrc
or $HOME/.zshrc
:
# Android SDK
export ANDROID_HOME="$HOME/Library/Android/sdk" # for Homebrew
# export ANDROID_HOME="$HOME"/Android/Sdk # for Linux
export ANDROID_SDK_ROOT="$ANDROID_HOME"
export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/emulator:$ANDROID_HOME/platform-tools:$PATH"
#
export PATH="/usr/local/share/android-commandlinetools/cmdline-tools/latest/bin:$PATH"
sudo su - "$USER"
#
emulator -help
sdkmanager --help
avdmanager -h
# Licenses
yes | sdkmanager --licenses
#
sdkmanager --update
#
adb shell getprop
WARNING | /absolute/path/to/Library/Android/sdk/system-images/android-25/google_apis/x86_64/ is not a valid directory.
WARNING | emulator has searched the above paths but found no valid sdk root directory.
PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [/absolute/path/to/Library/Android/sdk]!
avdmanager list avd
avb_ops_user.cpp:217: ERROR: Error writing data.
avb_user_verity.c:205: ERROR: Error writing to partition 'vbmeta'
Skipping /system for remount
[liblp]bool android::fs_mgr::WritePrimaryMetadata(int, const android::fs_mgr::LpMetadata &, uint32_t, const std::string &, const std::function<bool (int, const std::string &)> &) write 740 bytes failed: Operation not permitted
[libfs_mgr]add partition scratch
[liblp]bool android::fs_mgr::WritePrimaryMetadata(int, const android::fs_mgr::LpMetadata &, uint32_t, const std::string &, const std::function<bool (int, const std::string &)> &) write 740 bytes failed: Operation not permitted
[libfs_mgr]add partition scratch
[liblp]bool android::fs_mgr::WritePrimaryMetadata(int, const android::fs_mgr::LpMetadata &, uint32_t, const std::string &, const std::function<bool (int, const std::string &)> &) write 740 bytes failed: Operation not permitted
[libfs_mgr]add partition scratch
Can not mount overlayfs for partitions: No such file or directory
failed to remount partition dev:/dev/block/dm-3 mnt:/vendor: Permission denied
failed to remount partition dev:/dev/block/dm-2 mnt:/product: Permission denied
failed to remount partition dev:/dev/block/dm-1 mnt:/system_ext: Permission denied
remount failed
TODO
[4527752704]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at ../emulator/lib64/qt/lib
Could not launch '<user>/test/../emulator/qemu/darwin-x86_64/qemu-system-x86_64': No such file or directory
Missing cmdline-tools
, emulator
, platform-tools
, binary path in environment $PATH
.
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
org.xml.sax.SAXParseException; lineNumber: 141; columnNumber: 252; cvc-complex-type.2.4.a: Invalid content was found starting with element 'base-extension'. One of '{layoutlib}' is expected.
...
Uninstall Android Studio and try a fresh install.
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
...
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
...
Option 1:
- macOS
- System Preferences
- Network
- Verify Services
Option 2: jabba alias default openjdk@1.9.0
Warning: java.net.ConnectException: Operation timed out (Connection timed out)
TODO
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
...
adbd cannot run as root in production builds
- Tools
- AVD Manager
- Create Virtual Device...
- Select: Pixel 3 -> Next
- Tab: x86 Images
- Select: Nougat (Google APIs) -> Next
- Finish
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
TODO
Out of memory: Java heap space.
Please assign more memory to Gradle in the project's gradle.properties file.
echo 'org.gradle.jvmargs=-Xmx4096m' >> ./gradle.properties
Execution failed for task ':app:validateSigningRelease'.
> Keystore file /xxx/android/app/my-release-key.keystore not found for signing config 'release'.
#
keytool \
-keypass PASSWORD1 \
-storepass PASSWORD2 \
-genkeypair \
-v \
-keystore ./app/release.keystore \
-alias release \
-keyalg RSA \
-keysize 2048 \
-validity 10000
#
Example
IT Department
Example Inc.
Sao Paulo
Sao Paulo
BR
yes
#
cat << EOF >> ./keystore.properties
keyAlias=release
keyPassword=PASSWORD1
storeFile=release.keystore
storePassword=PASSWORD2
EOF
Warning: Failed to download any source lists!
Warning: IO exception while downloading manifest
Warning: IO exception while downloading manifest
Warning: Still waiting for package manifests to be fetched remotely.
#
sdkmanager --list --verbose
Info: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
# Try
jabba use openjdk@1.17.0
# Darwin
rm -fR ~/.android
rm -fR ~/Library/Android*