expo-cli & React Native
expo-cli
https://reactnative.dev/docs/environment-setup
You will only need a recent version of Node.js(LTS 12+) and a phone or emulator.
install
https://docs.expo.io/get-started/installation
$ npm i -g expo-cli
# yarn
$ yarn global add expo-cli
$ expo -V
# 3.21.13
$ expo init App_RN
$ cd App_RN && npm start
# OR
$ cd App_RN && yarn start
# OR
$ expo start
# you can open iOS, Android, or web from here, or run them directly with the commands below.
$ yarn android
$ yarn ios
$ yarn web
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
Scan the
QR Code
withExpo Client App
https://itunes.apple.com/app/apple-store/id982107779
https://play.google.com/store/apps/details?id=host.exp.exponent&referrer=www
tutorial
https://docs.expo.io/tutorial/planning/
online simulator
https://snack.expo.io/@xgqfrms/react-native-app
dev & live hot reloading
Expo DevTools is running at http://localhost:19002
Opening DevTools in the browser... (press shift-d
to disable)
To run the app with live reloading, choose one of:
• Scan the QR code
above with the Expo app (Android) or the Camera app (iOS).
• Press a
for Android emulator, or i
for iOS simulator, or w
to run on web.
• Press e
to send a link to your phone with email.
• Press s
to sign in and enable more options.
press Ctrl+C
to exit.
Expo Press ?
to show a list of all available commands.
› Press a
to run on Android device/emulator, or i to run on iOS simulator, or w to run on web.
› Press c
to show info on connecting new devices.
› Press d
to open DevTools in the default web browser.
› Press shift-d
to disable automatically opening DevTools at startup.
› Press e
to send an app link with email.
› Press p
to toggle production mode. (current mode: development)
› Press r
to restart bundler, or shift-r to restart and clear cache.
› Press o
to open the project in your editor.
› Press s
to sign out. (Signed in as @xgqfrms.)
Expo client app & scan QR code
https://reactnative.dev/docs/environment-setup
bug
OK
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/13222607.html
未经授权禁止转载,违者必究!