본문 바로가기
#컴퓨터 과학 [Computer Science]/운영체제 (Operating System)

[OS - 🍎 macOS] 번들 (Bundle)

by cy_mos 2022. 2. 24.
반응형
카테고리 게시글 작성 날짜 게시글 최근 수정 날짜 작성자
Operating System 2022-02-24 22:42 2022.02.26. 20:24 Dev.Yang

 

Understanding macOS application bundles by building an agent-based app

 

번들 (Bundle)은 정의된 구조와 파일 확장자를 가지는 디렉터리 (Directory)의 일종으로 macOS, iOS, tvOS, watchOS 등의 운영체제 환경에서 손쉽게 소프트웨어를 전달하기 위해 만들어졌습니다.

 

  • 번들 (Bundle) 확장자로는 .app, .framework, .kext, .plugin, .docset, .xpc, .qlgenerator, .component, .saver, .mdimporter 등의 확장자가 있습니다.
  • 번들 (Bundle) 내부에 세부적인 구조는 애플리케이션 번들 (Application Bundles), 프레임워크 번들 (Framework Bundles), Loadable Bundles, Localized Resources 등의 구조로 이루어졌습니다.

🛠 Application Bundles

애플리케이션 번들 (Application Bundles)은 디렉터리 계층을 가지는데, 최상단 디렉터리는 .app 형태의 확장자를 표기합니다. 또한, 애플리케이션 번들 (Application Bundles)의 최상단 Directory의 SubDriectory는 Contents Directory가 위치하며, 이Contents Directory 내부에는 보통 MacOS 명칭을 가지는 디렉터리가 포함됩니다. 이 Contents중 맥의 경우 MacOS, GNUStep 같은 경우엔 애플리케이션의 이름 파일이 존재하고, 여기에 애플리케이션의 실행파일이 포함됩니다. 그리고 Contents 안에는 Resource Directory가 자리하고 있으며, 여기에 애플리케이션의 Interface Build File, nib 파일이 위치합니다. 그리고 Contents 디렉터리 아래엔 없을수도 있지만 Plugins, Frameworks, 그리고 Shared Frameworks가 있어서 애플리케이션의 실행을 돕는다. 추가적으로 애플의 코드 서명을 받았을경우 _CodeSignature Driectory가 추가됩니다.

 

🛠 Bundle structure of an iOS application

iOS Application 기본적인 번들 (Bundle) 구조는 아래와 같습니다. 

 

MyApp.app/
   - Info.plist
   - MyApp
   - Default.png
   - Icon.png
   - Hand.png
   - MainWindow.nib
   - MyAppViewController.nib
   - WaterSounds/
      - Water1.aiff
      - Water2.aiff
   - en.lproj/
      - CustomView.nib
      - bird.png
      - Bye.txt
      - Localizable.strings
   - jp.lproj/
      - CustomView.nib
      - bird.png
      - Bye.txt
      - Localizable.strings

🛠 Bundle structure of an macOS application

macOS Application 기본적인 번들 (Bundle) 구조는 아래와 같습니다. 

 

MyApp.app/
   Contents/
      - Info.plist
      - MacOS/
         - MyApp
      - Resources/
         - Hand.tiff
         - MyApp.icns
         - WaterSounds/
            - Water1.aiff
            - Water2.aiff
         - en.lproj/
            - MyApp.nib
            - bird.tiff
            - Bye.txt
            - InfoPlist.strings
            - Localizable.strings
            - CitySounds/
               - city1.aiff
               - city2.aiff
         - jp.lproj/
            - MyApp.nib
            - bird.tiff
            - Bye.txt
            - InfoPlist.strings
            - Localizable.strings
            - CitySounds/
               - city1.aiff
               - city2.aiff

🛠 Framework Bundles

Framework Budles 또한 번들 (Bundles) 형태로 저장이 이루어지며, 최상단의 Directory는 .framework 확장자를 가집니다. 최상단 Direcotry 아래 SubDiretory에는 Versions Directory가 위치하며 해당 Directory에는 프레임워크의 한 버전 혹은 여러 버전이 있습니다. 그리고 각각의 Directory 안에는 프레임워크의 Dynamic library Code를 포함하고 있습니다. Versions 디렉터리는 또한 현재 버전의 Current 디렉터리로의 심볼릭 링크가 포함되어 있습니다.

 

MyFramework.framework/
   - MyFramework  -> Versions/Current/MyFramework
   - Resources    -> Versions/Current/Resources
   - Versions/
      - A/
         - MyFramework
         - Headers/
            - MyHeader.h
         - Resources/
            - English.lproj/
               - InfoPlist.strings
            - Info.plist
      - Current  -> A

🛠 Loadable Bundles

Loadable Bundles에는 RunTime에서 불러올수 있는 코드를 저장합니다. 또한, Loadable Bundles은 .bundle 확장자로 끝나며, 종종 플러그인에 사용되는데, 제일 대표적인 Bundle은 메일 (애플)에서 볼 수 있습니다.


🛠 Localized Resources in Bundles

Application Bundles에 포함된 .lproj Directory는 소프트웨어국제화와 지역화 파일들을 포함하고 있습니다. lproj Directory는 macOS 또는 iOS의 언어 선택에 따라 language_region.lproj 형식으로 표현됩니다. 예를 들어 ko.lproj 같은 경우, 한국어로 설정된 macOS에서 한글로 프로그램을 구동시켜줍니다. 이러한 폴더에는 .nib 파일이나 필요한 .string 파일이나 이미지를 포함시킬 수 있습니다.


🚀 REFERENCE

더보기
반응형

댓글