發表於 程式分享

ReactNative開發環境安裝

1.Tool : Expo

Introduction to Expo – Expo Documentation

2.Command

npm install --global expo-cli
expo init my-project
cd my-project
code .

npm start
Windows PowerShell
Copyright (C) Microsoft Corporation. 著作權所有,並保留一切權利。

請嘗試新的跨平台 PowerShell <https://aka.ms/pscore6>

PS D:\\GProj\\GReactNative\\my-project> npm start

> my-project@1.0.0 start D:\\GProj\\GReactNative\\my-project
> expo start

Starting project at D:\\GProj\\GReactNative\\my-project
Developer tools running on <http://localhost:19002>
Starting Metro Bundler
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▄▄▄ █▄▀▀▄▄ ▀█ █ ▄▄▄▄▄ █
█ █   █ ███▄█   ▄▄█ █   █ █
█ █▄▄▄█ ██▄▀▄▀███▀█ █▄▄▄█ █
█▄▄▄▄▄▄▄█ █ ▀▄▀ ▀ █▄▄▄▄▄▄▄█
█  ▀ ▄█▄▀█ ▄▄▀▀█▀ █▄█▀█▀▀▄█
█ ▀ ▀▀ ▄█▄▀  ▀▄▄▄▀▀███▄▀▀ █
█▀▄██ ▀▄▀█▄█▄▄▀▄ █ ▄▀▀█▀ ██
█ ▄█ ▄ ▄▀▀█▄ ▄▄█ ▄▀ ██▄▀  █
█▄████▄▄▄▀▄█▀   █ ▄▄▄  ▄▀▄█
█ ▄▄▄▄▄ ██▀ ▄  ▄█ █▄█ ██▀ █
█ █   █ █ ██▀▀██▄ ▄  ▄ █▀▀█
█ █▄▄▄█ █▀ ▄  █▄ ▄█▀▀▄█   █
█▄▄▄▄▄▄▄█▄█▄▄██▄▄▄▄█▄▄███▄█

› Metro waiting on exp://192.168.0.110:19000
› Scan the QR code above with Expo Go (Android) or the Camera app (iOS)

› Press a │ open Android
› Press w │ open web

› Press r │ reload app
› Press m │ toggle menu
› Press d │ show developer tools
› shift+d │ toggle auto opening developer tools on startup (disabled)

› Press ? │ show all commands

Logs for your project will appear below. Press Ctrl+C to exit.

3.Install Expo Client in iOS / Android

4.重Load

  1. 實機: 搖一搖可以選選單
  2. iOS simulator ⇒ Command + R
  3. Android emulator ⇒ R + R

5.iOS simulator → XCode

Android emulator → Android Studio

發表留言