When you create a new project on Android Studio, the project's structure will appear with almost all the files in one SRC directory. This is a change that's been made to a generating system based on Gradle that provides greater flexibility while you're building. In addition, thanks to its integrated emulation system, Android Studio lets you view changes made to your app in real time so you can simultaneously see how everything is displayed on different Android devices according to different configurations and resolutions.
Among the many features offered by Android Studio are code-packing and tagging tools to help you organize yourself when implementing huge quantities of code, as well as a drag-and-drop system to move components around on the user interface. This new IDE also has Google Cloud Messaging, a feature to send data from the server to Android via the cloud so you can, for instance, send Push notifications to your apps. Android Studio can also help you track app development, giving you a more visual way to program and control the flow of the app.
What does Android Studio offer?
- A clear and robust development environment.
- Easy testing of functionality on different types of devices.
- Assistants and templates for commonly used programming elements on Android.
- A comprehensive editor with many extra tools to facilitate app development.
In this tutorial, you will learn, how to setup Android Studio on Mac OS Sierra and how to create a simple Ionic 2 project. And how to generate the Android APK file.
Prerequisite
1. Java
2. Android Studio
As new tools and other APIs become available, Android Studio tells you with a pop-up, or you can check for updates by clicking Help Check for Update. 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. Installation Steps of Android Studio for Mac. Following are the steps for installing Android studio for Mac: 1. By clicking the below link you will direct to the official page of Android Studio where you will get an option to download Android Studio. Android Studio is a new IDE for the Android operating system. Launched by Google, it offers new tools for developing apps and is a good alternative to Eclipse, currently the most popular IDE.
You must first install Java before installing the Android Studio.
Install Java
Download Java 1.8 using the below link
Install Android Studio Mac
The latest version of Android Studio is 4.1 on Mac Informer. It is a perfect match for the Developer Tools category. The app is developed by Google and its user rating is 5 out of 5.
Download the dmg file and double click to install the Java. Once you finished the installation, go to terminal and type
How To Download Android Studio On Macbook
The above two command will return the installed Java version. If the above command is not working, then the Java is not installed properly or Java is not configured in the PATH. However, most of the times it won't fail.
Install Android Studio
Download the Android studio using the below link
It is also dmg file. Double click and finish the installation.
Add Android Studio Path
After installing Android Studio, you must include it in the PATH. Execute the below command in the terminal.
Update Android Studio SDK
Open Android Studio and click SDK manager
Install the latest SDK tools like 5,6,7 versions. It will take some time depend on your internet connection.
Create Ionic 2 Project
You need the Ionic framework, before creating the Ionic 2 project. If you have not installed Ionic Framework, then visit the below link to learn, how to install the Ionic framework.
Create a new Ionic 2 project using
After creating Ionic 2 project, add Android platform to the Ionic project using
Then generate APK using the below command
After generating the APK successfully, the terminal will display the APK generated location.
That's all. You were done.
Please note. Now you can install the APK in your Android phone by enabling the Install from Unknown Source in settings. However You are not able to publish this APK to Google Play store. To publish to the Google Play Store, you need to do some extra work. I write a separate post soon for how to publish your APK to the Google Play Store using Ionic 2 Framework.
While generating the APK in Mac OS Sierra, sometimes you will face the below error message
Error: Could not find Gradle wrapper within Android SDK. Might need to update your Android SDK - Android
If you encounter that error, then follow this solution.