简体   繁体   English

在IntelliJ IDEA中运行iOS React Native项目时如何指定设备

[英]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.

相关问题 如何在运行 React Native 应用程序的 iOS 设备中启用实时重载? - How to enable Live Reload in iOS Device running React Native app? 如何在React Native项目的iOS真实设备中调试? - How to debug in iOS real device on React Native project? 在iOS设备上运行棒式快速反应本机项目时出错 - Getting error while running clubbed swift & react-native project on iOS device 当React Native应用未在iOS设备上启动时如何调试 - how to debug when react native app doesnt start on ios device iOS:在真实设备上运行项目时出错 - iOS: error when running project on real device Fresh React Native 项目在 IOS 15 版本上仅在归档和本地设备(M1 MacBook)上失败 - Fresh React Native Project Fails on IOS 15 build only when archiving and on local device (M1 MacBook) 在 IOS 设备上运行的 React Native 应用程序出现问题 - Having issue in React Native app running on IOS device 如何在Google Chrome上调试在物理iOS设备上运行的React Native应用程序 - How to debug on Google Chrome my React Native application running on physical iOS device 在launch.js中更改iOS模拟器设备以响应本机项目 - Change iOS simulator device in launch.js for react native project 如何解决“找不到config.h文件”? 从设备上的本机反应运行应用程序时? - How to solve “config.h file not found”? when running app from the react native on the device?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM