Twitter Feed Popout byInfofru

Deploy cordova application on specific ios emulator image

Lets make some simple stuff more complicated and more powerful. Below is a cute command to

Lets make some simple stuff more complicated and more powerful. Below is a cute command to emulate your cordova app on ios simulator or device. 

cordova run ios 
//or
cordova emulate ios

First shell command will search for the connected device and if not found just deploy the app to the default emulator and run it. 

Well in my scenario, I want to deploy my app to to iPhone 6 emulator image which uses IOS 8.4. To do that I first wants to know what are the available emulator images I have installed. Below script will do that

./platforms/ios/cordova/lib/list-emulator-images

Following output is from my machine

iPhone-4s, 8.4
iPhone-4s, 9.2
iPhone-5, 8.4
iPhone-5, 9.2
iPhone-5s, 8.4
iPhone-5s, 9.2
iPhone-6, 8.4
iPhone-6, 9.2

Just in case if you don't find emulator image of your choice. You can go to Simulator -> Hardware -> Device -> Manage Devices . 

And then click on the (+) button below and then select add simulator

Once you have devices listed in terminal using the shell given above. Below is how you can now deploy your app on specific IOS image

cordova emulate ios --target="iPhone-6, 8.4"