There are many different options to test native functionality depending on your target platforms and needs.
- Implement Platform Detection for the native functionality and test with
- Deploy to iOS
- Deploy to Android
- Deploy to iOS & Android instantly using Ionic DevApp
This article will focus on Ionic DevApp, as it includes the ability to test native functionality on a device.
Ionic DevApp extends the capabilities of Ionic Framework, making it easy to test apps directly on devices. DevApp offers a realtime view of changes as they're being made, with a rich library of pre-installed native plugins to test native features of the app.
There's no need to install complicated Native SDKs - all it takes is one simple command,
ionic serve, and apps running anywhere DevApp is installed will be immediately available to preview, with LiveReload to refresh changes as soon as they're made.
First, download the Ionic DevApp. It is available in the iOS App Store as well as Google Play
With DevApp installed, sign up or login to an Ionic Account.
DevApp is a free service that comes with every Ionic Account.
Serving the App
Make sure the device running DevApp and the computer are on the same network, then run
ionic serve from the command line in the project's directory.
[INFO] Development server running!
DevApp: [email protected] on ionic-home-router.network
Use Ctrl+C to quit this process
[INFO] Browser window opened to http://localhost:8100!
ionic serve running, open DevApp and select the app from the currently running app list.
Now if the app calls any native functionality, DevApp can handle this and actually return the correct native implementation.
DevApp has a select list of plugin it supports, so check out the DevApp docs for a complete list.