簡體   English   中英

在iOS設備上構建React Native應用

[英]Building React Native app on iOS device

我很好奇為什么我需要打開Xcode並單擊“構建並運行”(每個https://facebook.github.io/react-native/docs/running-on-device-ios.html#content )以能夠在我的iPhone上運行我的應用程序。

$ react-native help
Usage: react-native <command>

Commands:
  - start: starts the webserver
  - bundle: builds the javascript bundle for offline use
  - unbundle: builds javascript as "unbundle" for offline use
  - new-library: generates a native library bridge
  - link: Adds a third-party library to your project. Example: react-native   link awesome-camera
  - android: generates an Android project for your app
  - run-android: builds your app and starts it on a connected Android emulator or device
  - run-ios: builds your app and starts it on iOS simulator
  - upgrade: upgrade your app's template files to the latest version; run this after updating the react-native version in your package.json and running npm install

react-native命令的幫助頁面僅在iOS模擬器上顯示run-ios ,而run-android可以構建到設備或模擬器。

有誰知道我可以如何使用react-native-cli或其他命令行工具將應用程序直接構建到iPhone上的開發環境,就像我遵循上述文檔一樣?

我很確定這已鏈接到“配置文件”。 您需要具有配置文件才能在設備上運行應用程序,並且xCode可以處理它們。

由於不需要它們在模擬器上運行,因此可以直接使用react-native-cli啟動應用程序。 但是要在iPhone上運行它,您需要啟動xCode以與Apple一起驗證您的配置文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM