프로그래밍/Flutter

[Flutter] 첫 앱 시작하기

Beginner:) 2023. 12. 22.
320x100

먼저 나의 환경은 Windows10 ,VSCode이다.

 

환경 구성은 아래 포스팅에서 확인한다.

2023.12.21 - [프로그래밍/Flutter] - [Flutter] VSCode에서 Flutter 환경 구축하기

 

[Flutter] VSCode에서 Flutter 환경 구축하기

먼저 나의 환경은 Windows10이며 Flutter개발을 VSCode에서 진행하도록 환경을 세팅해본다. 크게 목차는 1. Flutter SDK 설치 2. VSCode 설치(+Flutter extension ) 3. Android Studio(Android SDK와 Emulate 등을 설치하기 위

park-duck.tistory.com

 


1. 프로젝트 생성

먼저 Flutter 프로젝트를 진행할 경로로 이동하여 프로젝트를 생성한 뒤 VSCode로 열어준다.

# flutter create [project_name]
flutter create with_calandar
cd with_calandar
code .

 

프로젝트를 생성하고 VSCode를 열어보면 아래와 같은 폴더들이 생성된다.

 

2. Emulator 실행

[Ctrl+Shift+p]를 눌러서 팔렛트를 실행한 뒤 "Flutter: Launch Emulator"를 선택한다.

 

 

만약 Luanch Emulator가 1분 이상 걸리거나 아래와 같이 licences accept 관련 에러가 발생한다면

 

"Failed to install the following Android SDK packages as some licences have not been accepted. 
   build-tools;30.0.1 Android SDK Build-Tools 30.0.1 
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager."

 

Android Studio에서 [File] - [Settings] - [Android SDK] - [SDK Tools]에서 "Google Play Licensing Library"를 설치한다.

 

 

설치한뒤 다시 [Ctrl+Shift+p]를 눌러 "Flutter: Launch Emulator"를 실행하면 애뮬레이터가 실행된다.

 

추가로 Windows에서 Iphone Emulator를 실행할 순 없다.

Mac OS에서 제공하는 XCode라는 것을 이용하여 Emulator를 실행하는데 Windows에서는 구동할 수 없는 프로그램이라나 ... 

 

3. Application 실행하기

VSCode에서 Debug 패널에서 디버그 시작하기 또는 "F5"로 디버그를 실행하면된다.

우측 하단 "+" 버튼을 클릭하면 중앙 Text의 숫자가 count++되는 것이 데모 App의 기능이다.

 

반응형

댓글