In this tutorial, you will learn, how to create a simple Ionic 2 project and run the project on the Genymotion emulator.
You must install the Genymotion. Use the below link, which explains, how to install the Genymotion emulator on Mac OS Sierra.
Now you have to set the ADB tools for the Genymotion emulator.
Open the Genymotion emulator and click the settings.
In the settings, click the ADB tab.
In the ADB tab, click the Use custom Android SDK tools. And give your Android SDK location.
If the location is correct, then it will display Android SDK tools found successfully.
Now Run the emulator by clicking the start.
Create a new Ionic 2 project using
ionic start gmd blank --v2
Then add the Android platform to that project using
cd gmd ionic platform add android
Now you are ready to run the project. Use the below command to run the project on the Genymotion emulator.
ionic run android
The above command creates an APK and deploys it in the Genymotion emulator by default.
That's all. Now you can run any project in the Genymotion emulator by simply calling the ionic run android command from your terminal.
Below is my ionic info while creating this tutorial( ionic info command).
Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.3.0
ios-deploy version: Not installed
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v6.10.0
Xcode version: Xcode 8.2.1