在终端中进行测试时,如何更改默认的Xcode iphone模拟器? [英] How to change the default Xcode iphone simulator when testing in the terminal?

查看:83
本文介绍了在终端中进行测试时,如何更改默认的Xcode iphone模拟器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这里有一个类似的问题: (如何在测试时更改默认的Xcode iphone模拟器) 但是它仍然没有回答如何在终端中执行此操作的问题.

I know there is a simular question here: (How to change the default Xcode iphone simulator when testing) But it still doesn't answer the question of how to do it in the terminal.

含义:我现在正在做一个React Native项目.当我在终端(react-native run-ios)中运行它时,它会打开iPhone6.现在,我想将此默认设置更改为iPhone 7,因为它在屏幕上效果更好.我该如何更改. (我曾尝试在Xcode中更改它,但它一直在变回来.)

Meaning: I'm working on a React Native project now & when I run it in the terminal (react-native run-ios) it opens iPhone 6. Now I would like to change this default to a iPhone 7 as it works better on my screen. How can I change this. (I've tried changing it in Xcode, but It keeps changing back.)

我已经浏览了所有类似的问题,但没有找到直接的答案.有人知道吗?

I have looked through All similar questions, and haven't found a straight forward answer. Does anyone know?

推荐答案

您可以在命令中提供首选的模拟器,如下所示:

You can provide your preferred simulator in the command as:

react-native run-ios --simulator="iPhone5"

您可以通过在终端上运行以下命令来检查可用的模拟器:

You can check the available simulators by running this command from the terminal:

xcrun simctl list devices

这篇关于在终端中进行测试时,如何更改默认的Xcode iphone模拟器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆