Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

coding etude

[fastlane] flutter android 세팅(2) 본문

Flutter(Dart)

[fastlane] flutter android 세팅(2)

코코리니 2024. 1. 10. 02:30

이전 포트팅에서 fastlane 의 설치와 초기화를 알아봤다.

이번 포스팅에서는 빠르게 Fastfile을 통하여 fastlane의 명령어를 입력하는 방법을 알아보자.

 

기본적인 내용은 fastlane 문서에 안와 있지만 가장 중요한 내용은 구조를 알면 나머지는 쉽다는 것이다.

default_platform(:android)
    platform :android do
        desc "Runs all the tests" ----> 구동에 대한 설명을 적는다.
        lane :test do ----> lane로 시작하여 do로 끝나면 정의된 명령어를 실행한다는 뜻.
            gradle(task: "test") ----> 실행문
        end  ----> lane의 종료
    end

 

다른것은 테스트를 진행할 때 하면 되고 지금부터 빌드와 업로드를 한번에 진행해보려고 한다.

lane: build_apk do 
    Dir.chdir '../..' do
        sh("flutter", "build", "apk")
    end
end  

lane: deploy do
    build_apk()
    upload_to_play_store
end

 

위 방법으로 진행하면 빌드 후 자동으로 업로드를 진행 하게 된다.

실행 방법

#./android 폴더 안에서 
$ fastlane deploy

 

참고사항

upload_to_play_store 는 매개변수로 옵셥값을 설정하여 업로드 상황을 통제 할 수 있다.

공식 홈페이지의 매개 변수 항목을 확인 후 활용해 보자.

https://docs.fastlane.tools/actions/upload_to_play_store/

 

upload_to_play_store - fastlane docs

<!-- This file is auto-generated and will be re-generated every time the docs are updated. To modify it, go to its source at https://github.com/fastlane/fastlane/blob/master/fastlane/lib/fastlane/actions/upload_to_play_store.rb --> upload_to_play_store Upl

docs.fastlane.tools

 

upload_to_play_store(
    track:'internal',
    release_status: 'completed',
    rollout: '1.0',
    apk: '../build/app/outputs/bundle/release/app-release.apk'
)

위 예시처럼 매개변수로 옵션값을 넣어 줄 수 있다.

 

다음은 fastlane를 통하여 배포하기 위한 play store console 셋팅과 build.gradle 세팅에 대해 포스팅을 진행해 보려고 한다.