--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
--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
--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