ionic tutorial - Run Ionic App on Emulator or on your Phone in Ionicframework - ionic framework - ionic 2 - ionic creator - ionic development
Run Ionic App on Emulator or on your Phone in Ionicframework
1. Add a platform target
iOS:
Android:
Windows:
2. Build your app
iOS:
Android:
Windows:
Windows:
Live Reload App During Development (beta)
The run or emulate command will deploy the app to the specified platform devices/emulators. You can also run live reload on the specified platform device by adding the --livereload option. The live reload functionality is similar to ionic serve, but instead of developing and debugging an app using a standard browser, the compiled hybrid app itself is watching for any changes to its files and reloading the app when needed. This reduces the requirement to constantly rebuild the app for small changes. However, any changes to plugins will still require a full rebuild. For live reload to work, the dev machine and device must be on the same local network, and the device must support web sockets.
With live reload enabled, an app’s console logs can also be printed to the terminal/command prompt by including the --consolelogs or -c option. Additionally, the development server’s request logs can be printed out using --serverlogs or -s options.
Command-line flags/options for run and emulate
While the server is running for live reload, you can use the following commands within the CLI:
3. Emulating your app
Deploys the Ionic app on specified platform emulator. This is simply an alias for run --emulator.
iOS:
Android:
Windows:
During emulating app in AVD or mobiles, you can inspect that app in chrome browser. Type following command in address bar of the chrome browser.
4. Running your app
Deploys the Ionic app on specified platform devices. If a device is not found it'll then deploy to an emulator/simulator.
iOS:
Android:
Windows:
4.1. Specifying your target
You can check the target name of your device/emulator running $ adb devices.