기본 유틸 및 개발 환경 구축
nodejs 설치
https://nodejs.org/en/download
vscode 설치
https://code.visualstudio.com/
git 설치
https://git-scm.com/download/win
도스명령어
npm install -g expo-cli
npx create-expo-app my-app >> npx create-expo-app SEOUL
npm install -g eas-cli
npx expo install react-native-webview
npx eas login (https://expo.dev/ 아이디생성 가능)
cd SEOUL
npx eas build:configure
App.js
import * as React from 'react';
import { WebView } from 'react-native-webview';
import { StyleSheet } from 'react-native';
import Constants from 'expo-constants';
export default function App() {
return (
<WebView
style={styles.container}
source={{ uri: 'https://seoul.go.kr' }}
/>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
marginTop: Constants.statusBarHeight,
},
});
eas.json
{
"cli": {
"version": ">= 7.6.0"
},
"build": {
"preview": {
"android": {
"buildType": "apk"
}
},
"preview2": {
"android": {
"gradleCommand": ":app:assembleRelease"
}
},
"preview3": {
"developmentClient": true
},
"preview4": {
"distribution": "internal"
},
"production": {}
}
}
npx eas build -p android --profile preview