-
iOS 기업 내부 전용 앱(ipa) 배포하기iOS 2024. 4. 2. 22:37
★ Enterprise 계정 필요
순서 개요
1. 앱 Identifier 생성
2. iOS Distribution Certificate 생성
3. Universal Distribution Profile 생성
4. Xcode에서 프로젝트 아카이브, ipa 파일 생성
5. ipa 파일 다운로드 경로가 포함된 manifest.plist 파일과 ipa 파일 서버에 업로드
6. manifest.plist 파일을 불러오면, 파일의 정보를 사용해서 itms-services 프로토콜을 통해 기기에 ipa 다운로드, 애플리케이션 설치
1, 2, 3 내용 생략
ipa 파일 생성
1. Archive
2. Distribute App 클릭
3. Custom(또는 Enterprise) 선택
4. Enterprise 선택
5. Distribution options 지정
App Thinning: 앱을 다운로드하는 사용자의 네트워크 연결 환경이 변하거나, 앱의 용량이 클 때 다운로드에 불편을 겪을 수 있습니다. 또한 제한적인 데이터를 사용할 때, 사용자는 추가적인 데이터 비용을 지불해야 할 수도 있습니다. 따라서 앱스토어는 모바일 네트워크 연결로 다운로드할 수 있는 앱 크기 제한을 걸어 놓고, 그 이상이라면 사용자가 Wi-Fi로 연결해서 앱을 다운로드 하도록 합니다. 따라서 앱 설치 수단을 늘리고 용량을 줄여 설치 시간을 최소화하고자 앱을 크기 제한보다 작게 만들기를 권장합니다.
위의 App Thinning 옵션을 특정 디바이스 또는 'All compatible device variants'를 적용해서 App Thinning Size Report를 받아서 용량을 줄이기 위해 사용하지 않는 assets을 확인하고 최적화를 수행하여 줄일 수 있다고 합니다.
저는 App Thinning 최적화에 대해서 잘 모르며, 앱 크기도 크지 않고 제외할 assets도 많지 않기 때문에, None으로 진행하겠습니다.
Additional Options: manifest.plist를 사용해서 웹을 통해 애플리케이션을 배포하려면 체크합니다.
어떤 식으로 manifest.plist가 생성되는지 알아보기 위해 아래와 같이 입력해보겠습니다.
인증서와 프로파일 선택
Export
ipa 파일과 함께 생성된 manifest.plist
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>items</key> <array> <dict> <key>assets</key> <array> <dict> <key>kind</key> <string>software-package</string> <key>url</key> <string>https://www.example.com/test.ipa</string> </dict> <dict> <key>kind</key> <string>display-image</string> <key>url</key> <string>https://www.example.com/testImage.57x57.png</string> </dict> <dict> <key>kind</key> <string>full-size-image</string> <key>url</key> <string>https://www.example.com/testImage.512x512.png</string> </dict> </array> <key>metadata</key> <dict> <key>bundle-identifier</key> <string>com.test</string> <key>bundle-version</key> <string>5.2</string> <key>kind</key> <string>software</string> <key>platform-identifier</key> <string>com.apple.platform.iphoneos</string> <key>title</key> <string>test</string> </dict> </dict> </array> </dict> </plist>
위에서 입력한 내용이 포함되어 있습니다. xml 형식의 파일이며, 이는 서버에서 개별 ipa 파일과 함께 manifest.plist 템플릿을 만들어두고 내부 값을 동적으로 생성 및 수정하여 제공해줄 수 있음을 의미합니다.
// Java MIME 유형 설정 response.setContentType("text/xml; charset=UTF-8");
Safari를 통해서 다운로드하는 링크 예시
<a href="itms-services://?action=download-manifest&url=https://myWeb.com/manifest.plist"> 다운로드</a>
manifest.plist에 접근할 때, 'HTTPS를 통해 .ipa 파일에 접근할 수 있는지, 사이트가 iOS와 iPadOS가 신뢰하는 인증서로 서명이 되어 있는지 확인해야 합니다. 자체 서명한 인증서에 신뢰할 수 있는 앵커가 없거나 기기에 의해 유효성을 확인할 수 없는 경우, 인증은 실패합니다.' 라고 문서에 명시되어 있습니다.
참고
Apple Document - 기업 내부 전용 앱 배포하기
(https://support.apple.com/ko-kr/guide/deployment/depce7cefc4d/web)
Apple Document - Reducing your app's size
(https://developer.apple.com/documentation/xcode/reducing-your-app-s-size)
'iOS' 카테고리의 다른 글
iOS WKWebView 파일 다운로드 (0) 2024.03.15 Apple Certificates (0) 2024.02.14 CLI 없이 Xcode Workspace에 Cordova Custom Plugin 추가하기 (0) 2023.06.23 Swift를 사용해서 Cordova Custom Plugin 만들기 (2) (0) 2023.05.25 Swift를 사용해서 Cordova Custom Plugin 만들기 (1) (0) 2023.05.25