프로젝트/헬스 다이어리 앱

[헬스 다이어리 앱 개발] 12편 - APK 파일 만들기

Junheehee 2022. 10. 9. 15:12

이제 드디어 apk 파일을 만들고 내 핸드폰에서 직접 실행해볼 차례다.

build는 공식 문서를 참고했다.

 

Creating your first build - Expo Documentation

Expo is an open-source platform for making universal native apps for Android, iOS, and the web with JavaScript and React.

docs.expo.dev

 

 

 

 

우선 app.json에서 정보를 수정해주자.

// app.json

{
  "expo": {
    "name": "운동하자",
    "slug": "HealthDiaryApp",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/health_app_logo.png",
    "userInterfaceStyle": "light",
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": ["**/*"],
    "ios": {
      "supportsTablet": true
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/health_app_logo.png",
        "backgroundColor": "#FFFFFF"
      }
    },
    "web": {
      "favicon": "./assets/health_app_logo.png"
    }
  }
}

앱 이름, 아이콘 등을 수정해줬다.

 

 

 

 

빌드는 eas-cli로 할 것인데, 그 전에 몇가지 설정을 해주자.

일단 지금 당장 스토어에 출시할 것이 아니라, 우선 apk 파일로 빌드한 뒤 사용해볼 계획이다.

별다른 설정 없이 빌드하면 aab 파일로 만들어지기 때문에, eas.json을 수정해주자.

(eas.json이 없다면 root 디렉토리에 만들자.)

// eas.json

{
  "build": {
    "preview": {
      "android": {
        "buildType": "apk"
      }
    },
    "preview2": {
      "android": {
        "gradleCommand": ":app:assembleRelease"
      }
    },
    "preview3": {
      "developmentClient": true
    },
    "production": {}
  }
}

 

 

Building APKs for Android emulators and devices - Expo Documentation

Expo is an open-source platform for making universal native apps for Android, iOS, and the web with JavaScript and React.

docs.expo.dev

 

 

 

 

이제 빌드가 완료되기를 기다리면 된다.

$ npx eas-cli build -p android --profile preview

 

 

생각보다 오래 걸려서 유튜브를 보며 기다렸다.

 

 

 

 

build된 앱은 expo 사이트에서 다운로드 가능하다.

다운로드 한 뒤 핸드폰에 설치했다.

 

 

 

 

완성!

 

 

 

 

내일부터 열심히 운동하고 일주일 정도 사용해봐야겠다.

 

운동하자.apk

 

drive.google.com

(아이폰은 아직 안된다.)

 

 

 

 

코드

 

 

GitHub - junhee-won/health-diary-app

Contribute to junhee-won/health-diary-app development by creating an account on GitHub.

github.com