Feb 19, 2019 Full mac tutorial on ionic build app. Ionic build IOS. Covering ionic cordova run android, ionic cordova build ios, and ionic build for web. Learn about ionic app building for real mobile devices.
We have understood how to install Cordova and set up the environment for it. Once everything is ready, we can create our first hybrid Cordova application.
Open the directory where you want the app to be installed in command prompt. We will create it on desktop.
CordovaProject is the directory name where the app is created.
io.cordova.hellocordova is the default reverse domain value. You should use your own domain value if possible.
CordovaApp is the title of your app.
You need to open your project directory in the command prompt. In our example, it is the CordovaProject. You should only choose platforms that you need. To be able to use the specified platform, you need to have installed the specific platform SDK. Since we are developing on windows, we can use the following platforms. We have already installed Android SDK, so we will only install android platform for this tutorial.
There are other platforms that can be used on Windows OS.
If you are developing on Mac, you can use −
You can also remove platform from your project by using −
In this step we will build the app for a specified platform so we can run it on mobile device or emulator.
Now we can run our app. If you are using the default emulator you should use −
If you want to use the external emulator or real device you should use −
NOTE − We will use the Genymotion android emulator since it is faster and more responsive than the default one. You can find the emulator here. You can also use real device for testing by enabling USB debugging from the options and connecting it to your computer via USB cable. For some devices, you will also need to install the USB driver.
Once we run the app, it will install it on the platform we specified. If everything is finished without errors, the output should show the default start screen of the app.
In our next tutorial, we will show you how to configure the Cordova Application.
Visual Studio Tools for Apache Cordova allow you to build cross-platform, multi-device hybrid apps based on Apache Cordova. In other tutorials, we’ve shown how to Build a Cordova app for iOS using Parallels so you can use the tools from your Mac. In this tutorial, we will show how to speed up Android emulation by running the Android emulator on OSX rather than inside Parallels running Windows using a SSH tunnel. The instructions here use the Android emulator as an example, but you should be able to do this with other emulators like GenyMotion as well.
Most of the steps in this section show how to install and configure Java and the Android SDK on your Mac. If you have already installed and configured Java and the Android SDK on your Mac, all you need to do is enable Remote Login in the OSX Sharing settings, and then you can skip to the Windows setup. If not, follow the complete step-by-step instructions in this section.
First, make sure that you have configured your Parallels VM setup to run in Shared Networking mode (it is the default setting).
Because you will be setting up an SSH tunnel, you will need to enable SSH logins for your Mac. Start the Settings app then go to Sharing and Check Remote Login.
Next, install and configure Java and the Android SDK.
Download and install JDK 7 for Mac. 2. Download the Android SDK tools for Mac.
Note: You can choose the download under Get the SDK for an existing IDE if you don’t intend to use the Android IDE directly.
Unzip the Android tools.
In this tutorial, we will assume you’ve unzipped it to your Documents folder (~/Documents/android-sdk-macosx).
Open the Terminal app and type the following command:
Deselect anything you do not want to install, but make sure the following are selected:
Android 4.4.2 (API 19)
Extras/Intel x86 Emulator Accelerator (HAXM installer)
Choose Install packages…
After the installation has completed, make sure you close the Android SDK Manager.
Install the Intel HAXM driver.
In Finder, go to Documents, android-sdk-macosx, extras, Intel, and then Hardware_Accelerated_Execution_Manager.
Open IntelHAXM_x.x.x.dmg
.
Open the .mpkg
file in the folder window that appears.
Unturned free download without steam. Follow the installation instructions.
In the Terminal app, type:
Create an AVD image, start it, and verify that it runs. Make sure to select the following options:
Set CPU/ABI to an Intel Atom (x86) system image.
Select Use Host GPU.
To start up your Android emulator images in the future, use the android avd
command.
Next, start Parallels and configure Windows.
Download plink from the Putty website and place it in a folder. Next, you will create two scripts. The scripts will shut down the “Android Debug Bridge (adb)” if it is running and setup an SSH tunnel from Windows to OSX.
For the first script, create a new file in this same folder called “connect-to-mac.cmd” and copy the following script into the file.
In the preceding script, replace:
jondoe123
with your Mac user name
johnspassword
with your Mac password
johnsmac.microsoft.com
with either the IP address or the host name of your Mac
For the second script, create another file in this same folder called mac-script.sh
and copy the following script into the file:
In the preceding script, replace ``~/Documents/android-sdk-macosx` with the location where you unzipped the Android SDK.
Windows is now configured and ready to go.
Follow these instructions each time you startup your Mac and Parallels.
In OSX, open the Terminal app and type:
Use the AVD Manager to start the Android emulator that you want to use.
On Windows in Parallels, take the following steps:
connect-to-mac.cmd
.connect-to-mac.cmd
.After you do this, you should connect any attached Android devices to the Mac side not the Windows side if prompted by Parallels.
That’s it! You can now start Visual Studio and run your app on the Android Emulator in the same way that you normally run it.