How do I run an app on a real iOS device using Expo?

浪尽此生 提交于 2019-12-03 16:42:10

问题


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?


回答1:


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.




回答2:


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:

  1. Connect both your computer and your iOS device with same Wi-Fi
  2. In Expo XDE, select Host > LAN (please refer to eden's answer)
  3. Open MobileSafari in your iOS device. Type the URL shown in Expo XDE (should be something like exp://192.168.123.123:19000). Alternatively, you can click "Share" button in Expo XDE to show a QR Code. Use Camera App in iOS (iOS 11+) or any QR code reader (iOS 9 & 10) to scan the QR Code.
  4. MobileSafari, or your QR code reader / Camera App, will ask if you want to launch the App in Expo Client App, select "Yes"
  5. Your project will be loaded accordingly.

Hope it helps.



来源:https://stackoverflow.com/questions/43730608/how-do-i-run-an-app-on-a-real-ios-device-using-expo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!