1 Installation Android Studio and SDK
To install Android Studio on your Mac, proceed as follows:
- Launch the Android Studio DMG file.
- Drag and drop Android Studio into the Applications folder, then launch Android Studio
Download:Android Studio
Now with Android Studio we can prceed to install the SDK:
- Open Android Studio
- Under the window you find the Configure> button, inside we click on SDK Manager.
- Install the android version that you want to use:
- Then install the SDK Tools, in this case we select all:
2 Add Virtual Device
To run your application you must first add a virtual device. We can select the type of device we want to use and the Android version.
- First click on AVD Manager:
- Then create Virtual Device:
- Select the device that you want to use:
- If you select a device that is compatible with Google Play select or download a version.
- Verify the configuration:
- And finally you can run the emulator:
3 Physical Android Phone
Poder utilizar nuestro propio dispositivo android hace que el ordenador no tenga que utilizar tantos recursos. Para poder utilizarlo solo hace falta un cable USB y configurar algunas opciones.
- First of all activates the developer options:
- Open the Settings app.
- (Only on Android 8.0 or higher) Select System.
- Scroll to the bottom and select About phone.
- Scroll to the bottom and tap Build number 7 times.
- Return to the previous screen to find Developer options near the bottom.
- Activate this options:
4 Create BashProfile for ANDROID_HOME
Bash_profile is a configuration file for bash shell. When bash is invoked as an interactive login shell it first reads and executes commands from ~/.bash_profile. ... This file can be used to export variables in shell.
In this case when we execute the command:
$ cordova build
- With superuser go to the folder
/var/root/
: - Since we don't have this file, we will create it :
- Now reload the bash_profile:Copy
$ source ~/.bash_profile
4.1 How to find the SDK folder
Where the Android-SDK is installed depends on how you installed it.
- If you downloaded the SDK through their website and then dragged/dropped the Application to your Applications folder, it's most likely here:
/Applications/ADT/sdk - If you installed the SDK using Homebrew (brew cask install android-sdk), then it's located here:
/usr/local/Caskroom/android-sdk/{YOUR_SDK_VERSION_NUMBER} - If the SDK was installed automatically as part of Android Studio then it's located here:
/Users/{YOUR_USER_NAME}/Library/Android/sdk