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.
cordova plugin add [email protected]
Next, add the iOS platform to the project. This will only need to be done once.
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.
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.
cordova build
Next, we will look at how to customize the app with a new icon and splash screen.
Text editor powered by tinymce.