Install java and android-sdk on Mac using homebrew

install java

--Check if java is installed --If the version is displayed, it is installed. --If java is not installed, install java with homebrew as well.

 java -version

--homebrew itself is assumed to be installed --Cask is required for both java installation and android-sdk installation, so tap it so that it can be used.

brew tap caskroom/versions

--Use cask to install the latest version of java

brew cask install java

--Install java8 etc. if necessary

brew cask install java8

--Check the installed java

/usr/libexec/java_home -V
Matching Java Virtual Machines (2):
    10.0.1, x86_64:	"Java SE 10.0.1"	/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
    1.8.0_172, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home

--Set the version of java to be used in ~ / .bash_profile --If ~ / .bash_profile does not exist, create a new one in Refer here --By the way, please use Refer here to properly use .bashrc and .bash_profile. --In the following, the version is specified as 8.

#Java version switching(install is brew cask install)
export JAVA_HOME=`/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java_home -v "1.8"`
PATH=${JAVA_HOME}/bin:${PATH}

--If you want to set the version to 10, do as follows

#Java version switching(install is brew cask install)
export JAVA_HOME=`/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java_home -v "10"`
PATH=${JAVA_HOME}/bin:${PATH}

--Reflect the settings

source ~/.bash_profile 

--Check the java version

 java -version

install android-sdk

--Use cask to install sdk and platform-tools

 brew cask install android-sdk
 brew cask install android-platform-tools

--Add the path to ~ / .bash_profile

# android-sdk tools path setting(install is brew cask install)
export ANDROID_HOME=“/usr/local/share/android-sdk”
export PATH=“${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools”

--Reflect the settings

source ~/.bash_profile 

--Confirm that the adb command can be used

witch adb

Use the adb command to browse the actual machine log

--Connect the actual device to the USB device --Refer to the log of the actual machine with the following command

adb logcat -v time

--Launch the application you want to monitor

Recommended Posts

Install java and android-sdk on Mac using homebrew
Install java and maven using brew on new mac
Install Java on Mac
Install Java 9 on windows 10 and CentOS 7
Install Java development environment on Mac
Download and install Eclipse (Java) (Mac version)
Install java with Homebrew
Install gradle on mac
Put Java 11 and spring tool suite on mac
Install Java 11 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Install Java 14 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Install SonarQube on Mac and challenge source analysis
Install Java 8 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Install openjdk11 on mac
Install Homebrew on Ubuntu 20.04
Install OpenJDK 8 on mac
Create a Java development environment using jenv on Mac
Install Java 8 (OpenJDK: Amazon Corretto) on macOS with Homebrew
Install Eclipse on Mac and translate it into Japanese
Install Java 8 (OpenJDK: Zulu Community) on macOS with Homebrew
Install OpenJDK7 (JAVA) on ubuntu 14.04
Install Java 7 with Homebrew (cask)
Install Java on WSL Ubuntu 18.04
Install tomcat + eclipse on mac
Install java 1.8.0 on Amazon linux2
Using multiple versions of Java with Brew on Mac + jEnv
[Java development environment construction] Install OpenJDK 11 (Java 11) on macOS with Homebrew.
Using Java on OSX 10.15 (Catalina) β
Install Java and Tomcat with Ansible
Install JDK and JRE on Ubuntu 16.10
Install Java with zip on Windows
Try using Redmine on Mac docker
Install ngrok on ubuntu16.04 using Vagrant
Install Ruby 2.5 on CentOS 7 using SCL
Install Java Open JDK 8 on CentOS 7
Installed on Lombok Mac (using STS)
Install and configure jenv on macOS
Enable Java 8 and Java 11 SDKs on Ubuntu
Notes on Java path and Package
Installing and using Ansible on Ubuntu 16.04
Install the memcached plugin on MySQL and access it from Java
I just want to write Java using Eclipse on my Mac
Steps to install Maven on Mac and use it in Eclipse
Install Ubuntu Server 20.04 in VirtualBox on Mac and connect with SSH
Install Docker on Ubuntu and set up remote connection using tls
How to check Java installed on Mac
If you can't install java on Catalina
Install docker and docker-compose on Alpine Linux
Using JupyterLab + Java with WSL on Windows 10
Java development environment construction memo on Mac
Install OpenJDK (Java) on the latest Ubuntu
Install Docker Desktop for Mac with Homebrew
How to install Eclipse (Photon) on Mac
Notes on operators using Java ~ String type ~
Sobel filter using OpenCV on Android (Java)
I can't install rails on my mac
How to switch Java versions on Mac
What is Java and Development Environment (MAC)
Build a Java development environment on Mac
Install Java8 with Yum on Amazon Linux
Hello World on Mac VS Code Java