[英]How do I run an app on a real iOS device using Expo?
I am using Expo to run my application.我正在使用 Expo 来运行我的应用程序。 I am able to see two options in Expo XDE:
我能够在 Expo XDE 中看到两个选项:
I want to run my app by directly connecting to my device.我想通过直接连接到我的设备来运行我的应用程序。 Is it possible with Expo?
Expo 可以吗?
Yes, it is possible, and quite easy to get it running. 是的,这是可能的,并且很容易让它运行。
Step 1: Open Expo XDE, and click on the gray cog to change host mode to LAN. 步骤1:打开Expo XDE,然后单击灰色齿轮将主机模式更改为LAN。 Make sure you enabled Development Mode.
确保启用了开发模式。 You'll see an URL right in front of you.
你会在你面前看到一个URL。 Wait until packager to start running.
等到打包机开始运行。
Step 2: Open Expo App in your mobile device, and click on the second tab ' Explore ' and enter the URL that starts with exp://192.168...
This is a local connection to your computer. 步骤2:在移动设备中打开Expo App,然后单击第二个选项卡“ Explore ”并输入以
exp://192.168...
开头的URL exp://192.168...
这是与您的计算机的本地连接。 You will see your app running in a minute. 您将在一分钟内看到您的应用运行。
Make sure your phone and computer are on the same WiFi! 确保您的手机和电脑在同一个WiFi上!
For further information, you may refer to official documents here . 有关详细信息,请参阅此处的官方文档。
As the Expo Client App is updated due to new Apple's approval requirements, please follow the steps below to launch the App in a real iOS device: 由于新的Apple批准要求更新了Expo Client应用程序,请按照以下步骤在真实iOS设备中启动应用程序:
Hope it helps. 希望能帮助到你。
If you are looking to run a native build without using Expo Go
on a physical iOS device (not a simulator), you can use the following code:如果您希望在物理 iOS 设备(而非模拟器)上不使用
Expo Go
来运行本机构建,则可以使用以下代码:
npx expo run:ios --device
This is useful in cases when you need to test notifications, native code, etc.这在您需要测试通知、本机代码等的情况下很有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.