NativeScript / nativescript-cli

Command-line interface for building NativeScript apps
https://www.npmjs.com/package/nativescript
Apache License 2.0
1.04k stars 195 forks source link

run on different ios device emulator #2013

Closed swapneshran closed 8 years ago

swapneshran commented 8 years ago

Hi

Now I am using angular2 seed advanced repo for development. I am able to develop android app.But in MAC i want to run the app in different device emulator.By default it is opening iPhone6S plus.

Please help what is the command if I want to run on iPhone5 or other device emulators. I have checked other devices are configured properly in xcode. Also showing in the available device by tns

Thanks in Advance Swapnesh

bfattori commented 8 years ago

When you launch the simulator you can select the model to use. Or, open XCode and switch the default device. However, from the CLI tool you can specify the phone to use:

tns emulate ios --available-devices

On my system, for example, I could then do:

tns emulate ios --device "iPad Air 2"

swapneshran commented 8 years ago

Hi Brett

Thanks for your quick reply.The above command is invoking the ios emulator.

But where to give the available device name in the below command

"tns livesync ios --emulator --watch"

Regards Swapnesh

tzraikov commented 8 years ago

@swapneshran: only the emulate command can start specific simulator. The livesync command will start the default one, if no one is running. You can change the device on a running simulator from the menu: Choose Hardware >>Device and select the wanted simulator.

If there is no running simulator, follow those steps to start one:

  1. Open Xcode.
  2. Choose Xcode >> Open Developer Tool Simulator
  3. Select the wanted simulator by choosing Hardware >> Device from its menu.
terreb commented 8 years ago

What if I have 2 running instances of simulator with different hardware and I need to run 2 different projects on them for livesyncying. Is it possible somehow?

JimLynchCodes commented 4 years ago

Hello!

@bfattori When I run tns emulate ios --available-devices I get an error:

Unknown command 'emulate'.

Has the command changed? 🤔

tns v6.3.3

Fatme commented 4 years ago

@JimLynchCodes,

tns emulate command is deleted and no longer supported.

In order to run an application on emulator, you can use tns run ios --emulator. In order to list available devices, you can use tns devices --available-devices.