Android studio is a very good Java-based IDE for developing and testing Android applications. It works as a stand-alone application. You download IDE, install it without explicit dependencies. You download an Android SDK and run on the emulator. So Android Studio provides many tools to build, run applications on different emulators.
Android SDK is based on Java SDK it can not work with Java SDK. So Java SDK is provided with the studio. There is a possibility to reuse another SDK. An interesting case appears when you start to use other tools for development like Cordova. There are a lot of articles on how to run Cordova. But almost all of them ask to install and set Cordova dependencies. It is very easy to be confused. I prefer to reuse Android studio tools for Cordova. This time I am developing on Mac. So I'll show settings for Mac.
Using from Android SDK by Cordova from CLI it asks for licenses.
And build an application by Cordova
Android SDK is based on Java SDK it can not work with Java SDK. So Java SDK is provided with the studio. There is a possibility to reuse another SDK. An interesting case appears when you start to use other tools for development like Cordova. There are a lot of articles on how to run Cordova. But almost all of them ask to install and set Cordova dependencies. It is very easy to be confused. I prefer to reuse Android studio tools for Cordova. This time I am developing on Mac. So I'll show settings for Mac.
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk export GRADLE=$HOME/.gradle/wrapper/dists/gradle-6.1.1-all/cfmwm155h49vnt3hynmlrsdst/gradle-6.1.1/bin export PATH=$PATH:$ANDROID_SDK_ROOT/emulator:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/tools:$GRADLE export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home
Using from Android SDK by Cordova from CLI it asks for licenses.
sdkmanager --licenses
And build an application by Cordova
cordova build android
Small analyses:
Android studio is installed(placed) into
/Applications/Android\ Studio.appJava SDK is placed inside Android Studio
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/HomeIt installs Android SDKs into a shared place
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdkPackage assembler is installed by and works globally taking settings from the home directory.
export GRADLE=$HOME/.gradle/wrapper/dists/gradle-6.1.1-all/cfmwm155h49vnt3hynmlrsdst/gradle-6.1.1/bin
Комментариев нет:
Отправить комментарий