且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用 Expo 在真实的 iOS 设备上运行应用程序?

更新时间:2023-10-20 13:38:58

是的,这是可能的,而且很容易运行.

第 1 步: 打开 Expo XDE,然后单击灰色齿轮将主机模式更改为 LAN.确保您启用了开发模式.您将在您面前看到一个 URL.等到打包程序开始运行.

第 2 步: 在您的移动设备中打开 Expo App,然后点击第二个标签Explore"并输入以 exp:/开头的 URL/192.168... 这是到您计算机的本地连接.您将在一分钟内看到您的应用正在运行.

确保您的手机和电脑在同一个 WiFi 上!

更多信息可以参考官方文档

I am using Expo to run my application. I am able to see two options in Expo XDE:

  1. open on iOS simulator
  2. open on Android

I want to run my app by directly connecting to my device. Is it possible with 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. Make sure you enabled Development Mode. You'll see an URL right in front of you. 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. You will see your app running in a minute.

Make sure your phone and computer are on the same WiFi!

For further information, you may refer to official documents here.