본문 바로가기
프로그래밍/Android-Java

[ANDROID] react-native 설치 & 프로젝트 생성

by 채연2 2021. 1. 18.

cmd 창을 열어서 nodeJS가 설치되어있는지 확인해보기.

설치가 되어있지 않다면 따로 설치하고 시작하기 바람

>node --version
v12.16.2

 

다음과 같이 [ npm install -g react-native-cli ] 명령어를 실행해준다.

-g : global. 전역 범위에서 설치, 사용 하겠다는 의미

>npm install -g react-native-cli
...\AppData\Roaming\npm\react-native -> ...\AppData\Roaming\npm\node_modules\react-native-cli\i
ndex.js
+ react-native-cli@2.0.1
added 79 packages from 28 contributors in 3.189s

 

npm으로 설치가 완료되면 다음과 같이 [ react-native init TestProject ] 명령어를 실행하여 프로젝트를 생성해준다.

>react-native init TestProject
This will walk you through creating a new React Native project in ...\TestProject
Using yarn v1.22.4
Installing react-native...
yarn add v1.22.4
info No lockfile found.
[1/4] Resolving packages...

....

Done in 16.04s.

  Run instructions for iOS:
    • cd "...\TestProject" && npx react-native run-ios
    - or -
    • Open TestProject\ios\TestProject.xcodeproj in Xcode or run "xed -b ios"
    • Hit the Run button

  Run instructions for Android:
    • Have an Android emulator running (quickest way to get started), or a device connected.
    • cd "C:\Users\KimCY\TestProject" && npx react-native run-android

  Run instructions for Windows and macOS:
    • See https://aka.ms/ReactNative for the latest up-to-date instructions.

 

320x100

'프로그래밍 > Android-Java' 카테고리의 다른 글

[ANDROID] Activity View 구하기  (0) 2021.02.18
[ANDROID] byte array rotate  (0) 2021.01.27
[ANDROID] onKeyDown KeyEvent 변경  (0) 2021.01.15
[ANDROID] StringBuffer 비우기  (0) 2020.12.16
[ANDROID] byte array 초기화  (0) 2020.12.16

댓글