본문 바로가기
App/IOS

[React Native] 시작하기

by yonikim 2024. 7. 25.
728x90

React Native 란?

React Native는 페이스북에서 개발한 오픈소스 프레임워크로, Javascript와 React를 사용하여 IOS 및 Android 플랫폼용 모바일 애플리케이션을 개발할 수 있게 한다. 

 

React Native 앱 개발을 시작하기 위해선 아래와 같은 몇가지 앱 설치가 필요하다.

1. Node.js 와 npm 설치

2. 플랫폼에 맞는 IDE 설치 (ex. Visual Studio Code, Android Studio)

3. XCode 설치 (Mac 사용시)

 

1. Node.js 설치

https://nodejs.org/en/download/package-manager

 

Node.js — Download Node.js®

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.

nodejs.org

 

2. Visual Studio Code 설치

https://code.visualstudio.com/

 

Visual Studio Code - Code Editing. Redefined

Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.  Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows.

code.visualstudio.com

 

3. Andriod Studio 설치 

https://developer.android.com/studio?hl=ko

 

Android 스튜디오 및 앱 도구 다운로드 - Android 개발자  |  Android Studio  |  Android Developers

Android Studio provides app builders with an integrated development environment (IDE) optimized for Android apps. Download Android Studio today.

developer.android.com

 

4. Xcode 설치

https://apps.apple.com/us/app/xcode/id497799835?mt=12/

 

‎Xcode

‎Xcode includes everything developers need to create great applications for Mac, iPhone, iPad, Apple TV, Apple Watch and Apple Vision Pro. Xcode provides developers a unified workflow for user interface design, coding, testing, and debugging. The Xcode I

apps.apple.com

 


 

React Native 앱 프로젝트를 생성하는 방법으로는 Expo CLI 를 사용하거나 React Native CLI 를 사용하는 2가지의 방법이 있다. 

 

1. Expo CLI

1) Expo CLI 설치 

npm install -g expo-cli

 

2) 프로젝트 생성

npx create-expo-app ReactNativeApp

 

3) 프로젝트 실행

cd ReactNativeApp
npx expo start

 

3-1) 안드로이드의 경우 AVD 실행 후, 새로운 콘솔을 열어 아래 명령어를 실행한다.

npm run android

 

3-2) 아이폰의 경우 실행시 나타나는 QR 코드를 핸드폰의 Expo Go 앱을 열어서 스캔한다.

 

 

2. React Native CLI

1) React Native CLI 설치

npm install -g react-native-cli

 

2) 프로젝트 생성

react-native init ReactNativeApp

 

3) 프로젝트 실행

cd ReactNativeApp 
npm run android # 안드로이드
npm run ios # 아이폰

 

728x90

'App > IOS' 카테고리의 다른 글

[React Native] react-native-vector-icons 사용하기  (0) 2024.07.27