Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 클린 코드
- UITextView
- collectionview
- UICollectionView
- tableView
- ios
- swift documentation
- Clean Code
- rxswift
- Xcode
- 리팩토링
- swiftUI
- uiscrollview
- Human interface guide
- Protocol
- combine
- HIG
- RxCocoa
- Observable
- ribs
- map
- clean architecture
- scrollview
- 리펙토링
- uitableview
- 스위프트
- SWIFT
- 애니메이션
- MVVM
- Refactoring
Archives
- Today
- Total
김종권의 iOS 앱 개발 알아가기
[iOS - swift] Build Scheme 나누는 방법 (debug, release) 본문
Xcode에서 Release 스킴 추가하기
- scheme 버튼 클릭

- New Scheme 클릭

- ExCheme-Release 입력 후 OK 클릭

- 생성된 것 확인 -> Edit Scheme 클릭

- Release 스킴인지 확인 후, Build Configuration을 Release로 변경

- 추후에, Project의 Configuration을 설정하는 곳은 Project -> Configurations에서 인증서나 .config 파일 관리
- configuration을 사용하여 phase 관리하는 방법은 이전 포스팅 글, 배포 환경 설정 참고

Phase 별 빌드 세팅
- custom flag 설정 (매크로 상수)
- Target -> Build Settings -> swift compiler - Custom Flags

ex) Release의 custom flags를 RELEASE로 한 경우, #if RELEASE로 접근 가능

import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let token: String
#if DEBUG
token = "debug token"
#elseif RELEASE
token = "debug token"
#endif
print(token)
}
}
- bundle id (debug, release만 간단하게 사용할 경우 같아도 무방)
- Target -> Build Settings -> Product Bundle Identifier

* configuration 사용, alpha, beta, 등등 조금 더 상세한 설정 방법은 이전 포스팅 글, 배포 환경 설정 참고
* 참고
https://shockoe.com/ideas/development/how-to-setup-configurations-and-schemes-in-xcode/