In addition to the solutions provided by te collegues I can also suggest the following when you have multiple connected devices/emulators and want to test on one specific:
- Check your currently started devices/simulators/emulators with
tns device
will return something like
│ # │ Device Name │ Platform │ Device Identifier │ Type │ Status │
│ 1 │ vbox86p │ Android │ 192.168.56.101:5555 | Emulator │ Connected │
│ 2 │ iPhone 5 │ iOS │ f5ae7a02a8ba77fa572 │ Device │ Connected │
│ 3 │ iPhone 6 │ iOS │ 03AEBB35-4EC4-4DCC │ Emulator │ Connected |
- Select your desired device (copy its ID or Device Identifier) and run the following:
tns run ios --device ID
or
tns run ios --device deviceIdentifier
for example:
tns run android --device 1 // will run on Android device
tns run ios --device 3 // will run on the iOS emulator
tns run ios --device f5ae7a02a8ba77fa572 // will run on the iOS device