Testing the App

Before testing our app, we will need to add the Cordova whitelist plugin to our app, and to add the iOS platform. First add the plugin using the following command. This will only need to be done once for any plugin you use.

Download: file
cordova plugin add [email protected]

Next, add the iOS platform to the project. This will only need to be done once.

Download: file
cordova platform add ios

iOS Simulator

Now we are ready to run the app in the iOS simulator. Run the following command to build the app and launch the simulator.

Download: file
cordova emulate

iOS Device

Now we are ready to test the app on an actual iOS device. Plug your device in using a USB cable, and open XCode 7. Once XCode has finished opening, we will open the project using the File->Open menu. Navigate to the weather/platforms/ios folder and open Weather.xcodeproj.

Once the project has opened, click the play button at the top of the window to build and install the app on your device. Make sure the device is unlocked before clicking the play button.

The app should now launch on your device and display the weather! If you modify any of the files in the project, you will need to run the following command before uploading to your device.

Download: file
cordova build

Next, we will look at how to customize the app with a new icon and splash screen.

This guide was first published on Jun 26, 2015. It was last updated on Jun 26, 2015.
This page (Testing the App) was last updated on Jul 05, 2020.