[英]How to specify device when running an iOS React Native project in IntelliJ IDEA
I have a basic React Native project setup in IntelliJ IDEA IDE. 我在IntelliJ IDEA IDE中有一个基本的React Native项目设置。 When I hit "Run" it runs on iOS Simulator without asking which device to run on, but I want to run it on a physical device. 当我点击“运行”时,它可以在iOS Simulator上运行,而无需询问要在哪个设备上运行,但是我想在物理设备上运行它。
Did this by adding a device argument in the run configuration. 通过在运行配置中添加设备参数来做到这一点。
Goto -> Run(on toolbar) -> Select the project -> add "--device [DEVICE_NAME]" to the "Run arguments" field, click apply/Ok and you're good to go. 转到->运行(在工具栏上)->选择项目->在“运行参数”字段中添加“ --device [DEVICE_NAME]”,单击“应用/确定”,一切顺利。
screenshot of the window 窗口的屏幕截图
PS : To know or change the name of your physical iPhone, on the iPhone goto Settings -> General -> About, and the name should be there. PS:要了解或更改您的物理iPhone的名称,请在iPhone上转到“设置”->“常规”->“关于”,并且该名称应在此处。
Also, if you want to check if your mac can see your plugged in device, run "instruments -s devices" in the terminal to see all devices connected including simulators. 另外,如果要检查Mac是否可以看到插入的设备,请在终端中运行“ instruments -s devices”以查看所有连接的设备(包括模拟器)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.