How to choose an iOS simulator


#1

How can I choose which iOS simulator gets launched when I run tns run ios? It always launches the iPhone X and I can’t find how to change it to a different simulated device.

I can see in the tns run helpfile that I can choose a device by device ID, but when I run tns device to look for device IDs, it shows nothing (unless the iPhone X simulator is running, and then it shows that).

I can launch the simulator from Xcode, and then maybe I could see it in tns device and launch it using tns run. But I can’t figure out how to launch a device other than iPhone X from Xcode - it only launches the most recently used device. It seems there is a way to select a device if you have an Xcode project. Do I have to create a project just to launch a simulator?


#2

I figured it out. With the simulator open, go to Hardware menu -> Device -> iOS 11.1, and select a different iOS device, and close the iPhone X simulator. Now tns run ios opens in the desired device simulator, and after that simulator is closed, tns run ios re-opens it.