3

I have tried to run Ionic 3 app on Mac machine.No build errors and working fine on simulator.But I need to test it on Emulator hence I need to test the Native status bar plugin.Can you tell me why it gives below error? How can I run this on Emulator?

Note: I don't have an iOS device.Hence I'm using rented cloud Mac machine and try to test the iOS status bar implementation.

I have used this cli command:

> ionic cordova run ios

and this too ionic cordova emulate ios same issue.

global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.8
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.1.2 ios 4.4.0
    Ionic Framework                 : ionic-angular 3.4.2

System:

    Node       : v6.10.2
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.3 Build version 8E3004b
    ios-deploy : 1.9.1
    ios-sim    : 6.0.0
    npm        : 3.10.10

No target specified for emulator. Deploying to iPhone-SE, 10.3 simulator

Update:

When I run the > cordova run --list --emulator on Mac machine it shows huge list of emulators as like :

iPhone-6, 8.2
iPhone-6, 8.3
iPhone-6, 10.3
iPhone-6, 8.4
iPhone-6, 9.0
iPhone-6, 9.1
iPhone-6, 9.2
iPhone-6, 8.1
iPhone-6, 9.3
iPhone-6-Plus, 8.2
iPhone-6-Plus, 8.3
iPhone-6-Plus, 10.3

Update 2:

I have run this:

ionic cordova run ios --target="iPhone-6, 10.3"

It gives this error.Can you tell me why?

Error: Cannot read property 'name' of undefined

[ERROR] Cordova encountered an error. You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova run ios --target "iPhone-6, 10.3" (exit code 1).

Sampath
  • 63,341
  • 64
  • 307
  • 441
  • I'm not sure if I understand the question properly, but I think it's only a matter of terminology. You can check the difference between _simulator_ and _emulator_ [here](https://stackoverflow.com/questions/4544588/difference-between-iphone-simulator-and-android-emulator). If you want to run the app on a particular device, run `ios-sim showdevicetypes` and that will print a list of all the devices available to use in the simulator. Copy one of them and use it as the target like this: `ionic run ios --target="iPhone-6s, 10.3"` – sebaferreras Jul 02 '17 at 06:44
  • Actually, I want to run my app on `Emulator`.Because simulator doesn't show the `status bar`.@sebaferreras – Sampath Jul 02 '17 at 06:54
  • I don't have a device.I rent a cloud mac machine and try to test the iOS status bar implementation.http://ionicframework.com/docs/native/status-bar/ @sebaferreras – Sampath Jul 02 '17 at 06:57
  • I have run your command.But it gives an error.Please see the `Update 2`.@sebaferreras – Sampath Jul 02 '17 at 07:14

1 Answers1

1

Try this command:

ionic cordova run ios --target "iPhone-6"

I think there might be a bug on the current Cordova iOS that we cannot specify the target's iOS version, but at least we can specify the type of target's iOS device.

Charlie Ang
  • 931
  • 7
  • 7