Home
F Minus 1 (automatonvx) Mac OS

F Minus 1 (automatonvx) Mac OS

June 01 2021

F Minus 1 (automatonvx) Mac OS

  1. F Minus 1 (automatonvx) Mac Os X
  2. F Minus 1 (automatonvx) Mac Os Update

Translation(s): русский

MacBook Pro (15-inch 2.53 GHz), Mac OS X (10.7.5) Posted on Aug 9, 2013 12:05 PM Reply I have this question too (65) I have this question too Me too (65) Me too. Mac OS using PC Exchange stores its various dates, file attributes and long filenames in a hidden file called 'FINDER.DAT', and resource forks (a common Mac OS ADS) in a subdirectory called 'RESOURCE.FRK', in every directory where they are used. From PC Exchange 2.1 onwards, they store the Mac OS long filenames as standard FAT long filenames.

This page describes how to install Debian on a MacBook Pro.

Mac OS has a rather useful built-in utility called the Keyboard Viewer – an onscreen keyboard that displays many of the possible symbols. To Activate the Keyboard Viewer: 1. Open System Preferences- Keyboard. Tick the box labelled Show Keyboard and Character Viewers in menu bar. Yes, but it’s much much more than that. Apple invented something called the Open Scripting Architecture which is a method of passing events or messages between applications running on macOS.

Most points are the same like the MacBook so we point out the differences only.

Contents

Mac
  1. Install Debian
  2. Kernel
  3. X Window System
  4. Sound
  5. Touchpad
  6. Keyboard
  7. Debian 6 (squeeze) on MacBookPro7,1
  8. Appendix: Santa Rosa/LED MBP
  • Mar. 4, 2010, Debian testing on MacBookPro5,1: Installer works, but you might have to use dd to blow away the gpt tables from the BOTH the beginning and the end of your disk first, if it was once formatted by os x.

  • Feb. 10, 2010, Debian 5.0.4 on MacBookPro5,1: Default install runs error-free, but does not result in bootable installation. When machine tries to restart, screen fills partially with garbage and hangs. On manual hard restart, mac firmware shows flashing question-mark folder. -?AndrewWagner

  • July. 20, 2010, Current D-I(Debian 5.0.5 and testing) can not install on MacBookPro7,1. Because Linux kernel does not support MCP89 chipsetLinux:Bug 15923. (But this supports Linus/HEAD.) I backported this patch and made D-I. Work fine, Yay! -NobuhiroIwamatsu

  • July. 23, 2010, For MacBookPro7,1 use the Kernel since version 2.6.35-rc3.

  • Nov. 26 ,2010, 2.6.32-28 support ?MacBookPro7,1 and Macbook Air3,1.

  • Feb. 12, 2011, Debian 6 (squeeze) contains the kernel 2.6.32-5-amd64. The installation works out of the box for MacBookPro7,1. Nothing has to be patched manually to work properly. But there are some configurations to be done: Bluetooth, Wireless, Synaptics, Suspend to RAM. So I made up a new section for squeeze on MacBookPro7,1.

  • MacBook Pro specific bugs can be found at http://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=macbook-pro;users=kraai@ftbfs.org.

  • Ubuntu wiki page on the MacBook Pro

  • Gentoo wiki page on the MacBook Pro

  • Odi's documentation of Gentoo on the MacBook Pro

  • iDebian Blog with some tips for getting LIRC or the Mighty Mouse running

See the MacBook Install Debian section.

If the kernel panics when you press return at the ISOLINUX prompt, enter 'install noapic' at the ISOLINUX prompt (the kernel may panic while enabling the IO-APIC IRQs, bug 381719).

For MacBook Pro 13 (7,1)

(Obsolete with squeeze) Current installer can not install. But you can use Iwamatsu's D-I.

For MacBook Pro 13 (8,1)

First of all, it is important that you read carefully the MacBook Install Section of Debian Wiki, so that you can prepare your Macbook Pro, and understand the terms needed for proceeding with the installation.

Note that the current Debian installer can not install, because it is not able to load the components from the cdrom (I was able to install Debian in Dualboot scheme). However, it is possible to proceed using a usb driver in which you'll dump all the archives of the same iso image used for burning the cdrom for making the installation and 'cheating' the debian installer by mounting the USB in /cdrom as follows:

  1. Prepare the USB driver. For this, you'll need the same ISO that you used for burning the cdrom and execute (I did it with netinst image of Debian Testing): Where /dev/disk1 correspond to your USB. Note that you can do this even in Mac OS X or other linux machine.
  2. Proceed with the installation following the MacBook Install Section of Debian Wiki. It is important to boot with the USB attached to your Macbook Pro (if you don't do it like this, it may fail for mounting the device in /cdrom). But for installing, you are going to choose the cdrom as installer medium and not the USB.

  3. When the installer tries to load the components of the cdrom, it will fail. Now, open a TTY by executing Ctrl + Alt + F2, and mount the USB in /cdrom as follows: Where sdX should correspond to your device. Sometimes it can fail to mount the USB drive. If it doesn't work for you, then try to unplug the USB and plug it again. It should work.

    Note: If you boot directly from the USB medium the installer automatically detects the components as it were a CDRom, no need to mount it manually, no need for a CD at all.

  4. Go back to the installer by pressing Ctrl + Alt + F1, and keep doing the installation process up to GRUB or LILO. If you install either GRUB or LILO without syncing first, Linux won't boot. So, do not install any bootloader yet, and follow next step.

  5. At this point, you are going to sync the partitions using refit. Open again a TTY (Ctrl + Alt + F2) and install refit and gptsync (I downloaded the 2 required debian packages in another USB from http://packages.debian.org).

    Note: I didn't try by doing modprobe tg3, and use the internet connection (actually I didn't have idea about the module used until now ;)), but it should be worthy to try it (Instead of using other USB drive).

  6. Mount the USB containing refit and gptsync in /mnt: Copy the deb archives of refit /target/tmp:
  7. Chroot in /target and proceed to install refit and gptsync, and sync the MBR and GPT:
  8. Once you have synced, get back to the installer (Ctrl + Alt + F1) and proceed to install GRUB (I did it and it worked. I didn't try with LILO). It is really IMPORTANT that you select as partition /dev/sdX3 (Where X correspond to your partitioning scheme). If you install GRUB in the MBR, this won't work. Anyways, if you do it by error it is possible to erase the MBR in Mac OS X.

Done!, enjoy Debian in your MacBook Pro 8.1!

For MacBook Pro 15' (8,2)

Here's a step by step tutorial on how to setup Debian in EFI mode on the late 2011 ?MacBookPro8,2: http://dentifrice.poivron.org/laptops/macbookpro8,2/

linux-2.6 2.6.22 should work out of the box.

linux-2.6 2.6.18-3 supports MacBook Pros out of the box, but you'll need to ensure that the appletouch module is loaded before the usbhid module. You can do so by creating a file /etc/modprobe.d/local.conf that contains the following line:

For some reason, this doesn't always work.

The MacBook instructions suggest that you use the kernel parameters 'noapic irqpoll acpi=force'. I found that on a March 2008 MacBook Pro, the irqpoll option caused the CDROM drive (HL-DT-ST DVDRW GSA-S10N, ATAPI CD/DVD-ROM drive) to give errors along the lines of

Using 'noapic acpi=force' instead solved the problem.

Using stock kernel and patch from svn

You can build your own kernel using the stock Linux kernel and the patches found in the mactel-linux SVN. Here is the steps to follow:

  • download the source for the stock kernel from one of the kernel mirror,
  • get the mactel-linux patches with svn:
  • apply all the mactel-linux patches:
  • copy the config from the svn (trunk/kernel/mactel-patches-2.6.17/config-2.6.17-MBP) to your kernel dir, with name .config,

  • configure your kernel with make menuconfig, and control that CONFIG_FB_IMAC is not set,

  • build your kernel (fakeroot make-kpkg ...,

  • install your kernel (dpkg --install ...),

  • reboot.

See the MacBook page for other details.

The first MBP versions have an ATI card built in (MBP 2,2: ATI Technologies Inc M56P [Radeon Mobility X1600]). Later versions (MBP 3,1 and up) have an Nvidia card.

The installation of x.org should work out of the box with the lenny (and later) version of x.org (nv or radeonhd drivers).

ATI graphics

Lenny contains the free radeonhd driver (package name xserver-xorg-video-radeonhd) which supports the ATI card and 3D. Squeeze defaults to the free radeon driver (xserver-xorg-video-radeon); you need to install the package firmware-linux-nonfree to use 3D acceleration.

If you wish to use the binary vendor driver on ATI cards, install the non-free fglrx-driver package and, in the Device section of /etc/X11/xorg.conf, change the driver from 'ati' to 'fglrx'. Afterwards, to enable 3D you need to build the kernel fglrx module:

PowerPlay does not work with the fglrx driver as of v8.42. A patched radeontool is available at http://www.g2inf.one.pl/~anszom/MBP-ATI/.

NVidia graphics

With MacBookPro5,5 under Debian Lenny (2.6.26), use the NVidia proprietary driver. Brightness adjustment can be obtained by using Ubuntu packages

For MacBookPro7,1 download the driver from Nvidia (Geforce GT 320M) and install it manually. (Obsolete with squeeze)

See the MacBook/Wireless page.

(Obsolete with squeeze) For MacBookPro7,1 apply the following patch to Kernel 2.6.35-rc3:

Then modprobe btusb.

See the MacBook Sound section.

MacBookPro2

With a Core 2 Duo MacBook Pro and kernel 2.6.18-3-amd64 sound only works with the headphone but no speaker output.

With a Core2 Duo MacBook Pro (built fall 06) running (unpatched) 2.6.18-3-686, sound output can be changed as follows in alsamixer:

  • PCM channel changes overall volume
  • Center and LFE channels change volume of headphones output (which is at the jack labled as line in!)
  • Line in (only toggling mute possible) enables/disables built-in speakers
  • IEC958 enables/disables optical IO on jack labled as headphones
  • line in not yet worked out

MacBookPro3

With MBPv3 (mid 2007), sound works out-of-the-box starting with kernel 2.6.24.

MacBookPro5,5

With MacBook Pro 5.5 (mid 2009) with kernel 2.6.26, the following little hack helps to enable sound under Lenny.

Reboot

Under Squeeze, with kernel 2.6.32, simply add the following line to /etc/modprobe.d/alsa-base.conf

MacBookPro7,1

(Obsolete with squeeze) For MacBookPro7,1 with the kernel 2.6.35-rc3 and above, append the following line to /etc/modprobe.d/alsa-base

The front speaker can be unmuted with the gnome-alsamixer or with the alsamixer from console.

Apple ClickPad

Multi-touch gestures like the drag two-finger drag gesture are supported in the current xserver-xorg-input-synaptics package (>1.6.1).

If you would like your touchpad to behave like the natural scrolling mode in Mac OS X Lion, you have to add the next line to your ~/.Xmodmap

Apple Touchpad

?MacBookPro3,1 touchpad behavior might be smoother with the kernel boot option:

possibly adding it to the GRUB_CMDLINE_LINUX_DEFAULT line in /etc/defaults/grub

For older versions you can check PageFragmentClickPadOld

In the Keyboard section, it is possible to have an example on how to modify the .Xmodmap file.

For MacBook Pro 13 (8,1)

If your Macbook Pro has an English International Keyboard as this one: http://people.debian.org/~muammar/MB110Z.jpg So, the best layout you can use is the Macintosh (International) layout, and you can apply the next Xmodmap: http://people.debian.org/~muammar/Xmodmap which means that you download that file and you place it in your /home/ directory as .Xmodmap. In this Xmodmap file, the key Shift + 3 is showing the # instead of the £, and the question mark down (¿) is shown when pressing Alt-Right + /.

Before you proceed to use this file, it is good to make a backup of your current layout. You can execute:

Now, the diff between the Xmodmap.back and Xmodmap is pasted below, and thus you can have an idea on the changes and how to do them:

To be able to easily suspend to disk, or suspend to ram you can use the hibernate package. Note: Tested on MBP 2006

To use it use the command

For MacBookPro7,1 suspend to RAM works with s2ram from package uswsusp with the command

For squeeze see the section 'Debian 6 (squeeze) on MacBookPro7,1' below.

In combination with the acpi script lid.sh (I simply hacked that line into the script as last statement within the closing condition) it does exactly what you would expect on MacOS - the MBP suspends when closing the lid and awakens when it is opened. While sleeping, the LED is blinking.

With MacBookPro5,5 (Debian Squeeze), this HowTo was successful.

Create config file /etc/lirc/lirc.conf with

Set the driver in /etc/lirc/hardware.conf

Associate buttons with software/functions in .lircrc (make sure to use the same button names as in lirc.conf). See examples here

Make sure that daemons are launched at session start-up (Gnome > System/Preferencies/Session):

This Howto is reported to works. Under Squeeze, after iOS 4.3 update, you perhaps will need to update to following package from wheezy (testing) repositories :

In that case, you even need not to create SysInfoExtended yourself : simply install gvfs-fuse & ifuse; add yourself to the fuse group, reboot, plug your iPhone and launch Rhythmbox. That's it.

Here is just the configuration for the hardware, that does not work out of the box. (sound and graphics work fine)

Installation

You can use the Kernel 2.6.32-5-amd64. Installation from CD works out of the box.

Wireless

Follow the procedure.

Bluetooth

Just modprobe btusb.

Graphics

The nvidia-glx package works perfectly.

Synaptics

The Touchpad can be configured by some settings in xorg.conf. But when I installed Debian with XFCE, the were no xorg.conf. I simply created a new xorg.conf with the following content. With this configuration, the touchpad has a similar behaviour of MacOS (multi finger scroll, tapping, right-click with two fingers, mouse middle click with three fingers).

Hibernate

Hibernate has also suspend to ram with the command 'hibernate-ram'. So if you want to suspend to ram when the lid is closed, you can install hibernate and acpi-support (apt-get install hibernate acpi-support) and create an executable file named '/etc/acpi/local/lid.sh.pre':

Put the following content into this file:

Mostly everything is the same with a few changes. The testing distro has enough working drivers to get you started. The stable distro, however does not have a new enough version of the ethernet drivers to work. The other caveat here is that 'apt-get install grub' seems to give you grub2 which didn't seem to work for me. If you're using rEFIt to boot to a boot loader then you should turn use Lilo or grub 1.

See also: https://cbg.dyndns.org/wiki/ReadingCorner/LinuxOnMacbookPro

Ethernet

Requires a new version of sky2 available on the testing CD, but I am unsure as to what the minimum kernel version is. However, it works out of the box with kernel 2.6.22.

Video

Since v100.14.19, the binary nvidia driver works nicely on x86 and x64, no patches needed. The OSS driver 'nv' works too, but has very limited HW support.

Touchpad

The touchpad works fine with the synaptics driver, though maybe not as smooth as with OSX. Use GrabEventDevice if you want misc usb mice and synaptics touchpad special functions to work simultaneously. Patches from http://www.mactel-linux.org are optional.

Suspend2RAM

For MBPv3: For some reason, suspend2ram does not work with the free nv driver from xorg (bug 453782).

Works with binary nvidia drivers. VT/X-switching is needed with old nvidia drivers. Note that usb is necessary for keyboard/mice to work. These drivers should not be reloaded, otherwise the synaptics driver will lose its grab(GrabEventDevice, synaptics(5)) on the device. I also unload v4l, sky2 and madwifi before s2ram.

I used acpid to disable networking and echo mem > /sys/power/state on PWBTN.

Tested in debian/unstable, with vanilla linux 2.6.22/23. Alsa, uvcvideo and madwifi drivers taken from their corresponding repositories, i.e. working with various revisions of recent development drivers.

With Debian unstable and kernel 4.14.x suspend works out of the box but resumes very often. The reason is the USB 3.x ACPI configuration. This can be fixed with:

AppleIR

F Minus 1 (automatonvx) Mac Os X

Patch your kernel with https://cbg.dyndns.org/store/apple-remote-quirk-hiddev.patch. Enable CONFIG_USB_HID and CONFIG_USB_HIDDEV. When loading usbhid, a device /dev/usb/hiddev0 should be created. Use lirc to configure your remote. Reported to work with other remotes, too.

For a step by step guide, including elisa setup see http://www.e-hoffman.org/wiki/pmwiki.php?n=Main.AppleMacBookProV3

Here's what needs to be done:

  • Figure out how to install ELILO.
    • elilo failed to boot my kernel, though efi-boot was enabled. Direct efi-boot is reported to work very bad, as drivers(nvidia,networking) depend on some BIOS calls. http://www.madingley.org/macmini/ provides patches and some bios emulation code, but this is old and only for mac mini.

  • Figure out how to use the remote control.
  • See also: InstallingDebianOn/Apple

  • CategoryLaptopComputer

  • CategoryMacintoshComputer

Bundle structures can vary depending on the type of the bundle and the target platform. The following sections describe the bundle structures used most commonly in both macOS and iOS.

Note: Although bundles are one way of packaging executable code, they are not the only way that is supported. UNIX shell scripts and command-line tools do not use the bundle structure, neither do static and dynamic shared libraries.

Application Bundles

Application bundles are one of the most common types of bundle created by developers. The application bundle stores everything that the application requires for successful operation. Although the specific structure of an application bundle depends on the platform for which you are developing, the way you use the bundle is the same on both platforms. This chapter describes the structure of application bundles in both iOS and macOS.

What Files Go Into an Application Bundle?

Table 2-1 summarizes the types of files you are likely to find inside an application bundle. The exact location of these files varies from platform to platform and some resources may not be supported at all. For examples and more detailed information, see the platform-specific bundle sections in this chapter.

Table 2-1 Types of files in an application bundle

File

Description

Info.plist file

(Required) The information property list file is a structured file that contains configuration information for the application. The system relies on the presence of this file to identify relevant information about your application and any related files.

Executable

(Required) Every application must have an executable file. This file contains the application’s main entry point and any code that was statically linked to the application target.

Resource files

Resources are data files that live outside your application’s executable file. Resources typically consist of things like images, icons, sounds, nib files, strings files, configuration files, and data files (among others). Most resource files can be localized for a particular language or region or shared by all localizations.

The placement of resource files in the bundle directory structure depends on whether you are developing an iOS or Mac app.

Other support files

Mac apps can embed additional high-level resources such as private frameworks, plug-ins, document templates, and other custom data resources that are integral to the application. Although you can include custom data resources in your iOS application bundles, you cannot include custom frameworks or plug-ins.

Although most of the resources in an application bundle are optional, this may not always be the case. For example, iOS applications typically require additional image resources for the application’s icon and default screen. And although not explicitly required, most Mac apps include a custom icon instead of the default one provided by the system.

Anatomy of an iOS Application Bundle

The project templates provided by Xcode do most of the work necessary for setting up the bundle for your iPhone or iPad application. However, understanding the bundle structure can help you decide where you should place your own custom files. The bundle structure of iOS applications is geared more toward the needs of a mobile device. It uses a relatively flat structure with few extraneous directories in an effort to save disk space and simplify access to the files.

The iOS Application Bundle Structure

A typical iOS application bundle contains the application executable and any resources used by the application (for instance, the application icon, other images, and localized content) in the top-level bundle directory. Listing 2-1 shows the structure of a simple iPhone application called MyApp. The only files that are required to be in subdirectories are those that need to be localized; however, you could create additional subdirectories in your own applications to organize resources and other relevant files.

Listing 2-1 Bundle structure of an iOS application

Table 2-2 describes the contents of the application shown in Listing 2-1. Although the application itself is for demonstration purposes only, many of the files it contains represent specific files that iOS looks for when scanning an application bundle. Your own bundles would include some or all of these files depending on the features you support.

Table 2-2 Contents of a typical iOS application bundle

File

Description

MyApp

(Required) The executable file containing your application’s code. The name of this file is the same as your application name minus the .app extension.

Application icons (MyAppIcon.png, MySearchIcon.png, and MySettingsIcon.png)

(Required/Recommended) Application icons are used at specific times to represent the application. For example, different sizes of the application icon are displayed in the Home screen, in search results, and in the Settings application. Not all of the icons are required but most are recommended. For information about application icons, see Application Icon and Launch Images.

Info.plist

(Required) This file contains configuration information for the application, such as its bundle ID, version number, and display name. See The Information Property List File for further information.

Launch images (Default.png)

(Recommended) One or more images that show the initial interface of your application in a specific orientation. The system uses one of the provided launch images as a temporary background until your application loads its window and user interface. If your application does not provide any launch images, a black background is displayed while the application launches. For information about application icons, see Application Icon and Launch Images.

MainWindow.nib

(Recommended) The application’s main nib file contains the default interface objects to load at application launch time. Typically, this nib file contains the application’s main window object and an instance of the application delegate object. Other interface objects are then either loaded from additional nib files or created programmatically by the application. (The name of the main nib file can be changed by assigning a different value to the NSMainNibFile key in the Info.plist file. See The Information Property List File for further information.)

Settings.bundle

The Settings bundle is a special type of plug-in that contains any application-specific preferences that you want to add to the Settings application. This bundle contains property lists and other resource files to configure and display your preferences.

Custom resource files

Non-localized resources are placed at the top level directory and localized resources are placed in language-specific subdirectories of the application bundle. Resources consist of nib files, images, sound files, configuration files, strings files, and any other custom data files you need for your application. For more information about resources, see Resources in an iOS Application.

Note: An iOS app bundle cannot include a custom folder named “Resources.”

An iOS application should be internationalized and have a language.lproj folder for each language it supports. In addition to providing localized versions of your application’s custom resources, you can also localize your launch images by placing files with the same name in your language-specific project directories. Even if you provide localized versions, however, you should always include a default version of these files at the top-level of your application bundle. The default version is used in situations where a specific localization is not available. For more information about localized resources, see Localized Resources in Bundles.

The Information Property List File

Every iOS application must have an information property list (Info.plist) file containing the application’s configuration information. When you create a new iOS application project, Xcode creates this file automatically and sets the value of some of the key properties for you. Table 2-3 lists some additional keys that you should set explicitly. (Xcode obscures actual key names by default, so the string displayed by Xcode is also listed in parenthesis where one is used. You can see the real key names for all keys by Control-clicking the Information Property List key in the editor and choosing Show Raw Keys/Values from the contextual menu that appears.)

Table 2-3 Required keys for the Info.plist file

Key

Value

CFBundleDisplayName (Bundle display name)

The bundle display name is the name displayed underneath the application icon. This value should be localized for all supported languages.

CFBundleIdentifier (Bundle identifier)

The bundle identifier string identifies your application to the system. This string must be a uniform type identifier (UTI) that contains only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) characters. The string should also be in reverse-DNS format. For example, if your company’s domain is Ajax.com and you create an application named Hello, you could assign the string com.Ajax.Hello as your application’s bundle identifier.

The bundle identifier is used in validating the application signature.

CFBundleVersion (Bundle version)

The bundle version string specifies the build version number of the bundle. This value is a monotonically increased string, comprised of one or more period-separated integers. This value cannot be localized.

CFBundleIconFiles

An array of strings containing the filenames of the images used for the application’s assorted icons. Although technically not required, it is strongly encouraged that you use it.

This key is supported in iOS 3.2 and later.

LSRequiresIPhoneOS (Application requires iOS environment)

A Boolean value that indicates whether the bundle can run on iOS only. Xcode adds this key automatically and sets its value to true. You should not change the value of this key.

UIRequiredDeviceCapabilities

A key that tells iTunes and the App Store know which device-related features an application requires in order to run. iTunes and the mobile App Store use this list to prevent customers from installing applications on a device that does not support the listed capabilities.

The value of this key is either an array or a dictionary. If you use an array, the presence of a given key indicates the corresponding feature is required. If you use a dictionary, you must specify a Boolean value for each key indicating whether the feature is required. In both cases, not including a key indicates that the feature is not required.

For a list of keys to include in the dictionary, see Information Property List Key Reference. This key is supported in iOS 3.0 and later.

In addition to the keys in the preceding table, Table 2-4 lists some keys that are commonly used by iOS applications. Although these keys are not required, most provide a way to adjust the configuration of your application at launch time. Providing these keys can help ensure that your application is presented appropriately by the system.

Table 2-4 Keys commonly included in the Info.plist file

Para

Para

NSMainNibFile (Main nib file base name)

A string that identifies the name of the application’s main nib file. If you want to use a nib file other than the default one created for your project, associate the name of that nib file with this key. The name of the nib file should not include the .nib filename extension.

UIStatusBarStyle

A string that identifies the style of the status bar as the application launches. This value is based on the UIStatusBarStyle constants declared in UIApplication.h header file. The default style is UIStatusBarStyleDefault. The application can change this initial status-bar style when it finishes launching.

If you do not specify this key, iOS displays the default status bar.

UIStatusBarHidden

A Boolean value that determines whether the status bar is initially hidden when the application launches. Set it to true to hide the status bar. The default value is false.

UIInterfaceOrientation

A string that identifies the initial orientation of the application’s user interface. This value is based on the UIInterfaceOrientation constants declared in the UIApplication.h header file. The default style is UIInterfaceOrientationPortrait.

UIPrerenderedIcon

A Boolean value that indicates whether the application icon already includes gloss and bevel effects. The default value is false. Set it to true if you do not want the system to add these effects to your artwork.

UIRequiresPersistentWiFi

A Boolean value that notifies the system that the application uses the Wi-Fi network for communication. Applications that use Wi-Fi for any period of time must set this key to true; otherwise, after 30 minutes, the device shuts down Wi-Fi connections to save power. Setting this flag also lets the system know that it should display the network selection dialog when Wi-Fi is available but not currently being used. The default value is false.

Even if the value of this property is true, this key has no effect when the device is idle (that is, screen-locked). During that time, the application is considered inactive and, although it may function on some levels, it has no Wi-Fi connection.

UILaunchImageFile

A String containing the base filename used by the application’s launch images. If you do not specify this key, the base name is assumed to be the string Default.

Application Icon and Launch Images

Application icons and launch images are standard graphics that must be present in every application. Every application must specify an icon to be displayed on the device’s Home screen and in the App Store. And an application may specify several different icons for use in different situations. For example, applications can provide a small version of the application icon to use when displaying search results. Launch images provide visual feedback to the user that your application launched.

The image files used to represent icons and launch images must all reside in the root level of your bundle. How you identify these images to the system can vary, but the recommended way to specify your application icons is to use the CFBundleIconFiles key. For detailed information about how to specify the icons and launch images in your application, see the discussion of these items in Advanced App Tricks in App Programming Guide for iOS.

Note: In addition to the icons and launch image at the top level of your bundle, you can also include localized versions of launch images in your application’s language-specific project subdirectories. For more information about including localized resources in your application, see Localized Resources in Bundles.

Resources in an iOS Application

In an iOS application, nonlocalized resources are located at the top-level of the bundle directory, along with the application’s executable file and the Info.plist file. Most iOS applications have at least a few files at this level, including the application’s icon, launch image, and one or more nib files. Although you should place most nonlocalized resources in this top-level directory, you can also create subdirectories to organize your resource files. Localized resources must be placed in one or more language-specific subdirectories, which are discussed in more detail in Localized Resources in Bundles.

Listing 2-2 shows a fictional application that includes both localized and nonlocalized resources. The nonlocalized resources include Hand.png, MainWindow.nib, MyAppViewController.nib, and the contents of the WaterSounds directory. The localized resources include everything in the en.lproj and jp.lproj directories.

Listing 2-2 An iOS application with localized and nonlocalized resources

For information about finding resource files in your application bundle, see Accessing a Bundle's Contents. For information about how to load resource files and use them in your program, see Resource Programming Guide.

Anatomy of a macOS Application Bundle

The project templates provided by Xcode do most of the work necessary for setting up your Mac app bundle during development. However, understanding the bundle structure can help you decide where you should place your own custom files. macOS bundles use a highly organized structure to make it easier for the bundle-loading code to find resources and other important files in the bundle. The hierarchical nature also helps the system distinguish code bundles such as applications from the directory packages used by other applications to implement document types.

The Structure of a macOS Application Bundle

The basic structure of a Mac app bundle is very simple. At the top-level of the bundle is a directory named Contents. This directory contains everything, including the resources, executable code, private frameworks, private plug-ins, and support files needed by the application. While the Contents directory might seem superfluous, it identifies the bundle as a modern-style bundle and separates it from document and legacy bundle types found in earlier versions of Mac OS.

Listing 2-3 shows the high-level structure of a typical application bundle, including the immediate files and directories you are most likely to find inside the Contents directory. This structure represents the core of every Mac app.

Listing 2-3 The basic structure of a Mac app

Table 2-5 lists some of the directories that you might find inside the Contents directory, along with the purpose of each one. This list is not exhaustive but merely represents the directories in common usage.

Table 2-5 Subdirectories of the Contents directory

Directory

Description

MacOS

(Required) Contains the application’s standalone executable code. Typically, this directory contains only one binary file with your application’s main entry point and statically linked code. However, you may put other standalone executables (such as command-line tools) in this directory as well.

Resources

Contains all of the application’s resource files. This contents of this directory are further organized to distinguish between localized and nonlocalized resources. For more information about the structure of this directory, see The Resources Directory

Frameworks

Contains any private shared libraries and frameworks used by the executable. The frameworks in this directory are revision-locked to the application and cannot be superseded by any other, even newer, versions that may be available to the operating system. In other words, the frameworks included in this directory take precedence over any other similarly named frameworks found in other parts of the operating system.

For information on how to add private frameworks to your application bundle, see Framework Programming Guide.

PlugIns

Contains loadable bundles that extend the basic features of your application. You use this directory to include code modules that must be loaded into your application’s process space in order to be used. You would not use this directory to store standalone executables.

SharedSupport

Contains additional non-critical resources that do not impact the ability of the application to run. You might use this directory to include things like document templates, clip art, and tutorials that your application expects to be present but that do not affect the ability of your application to run.

Application bundles have evolved significantly over the years but the overall goal has been the same. The bundle organization makes it easier for the application to find its resources while making it harder for users to interfere with those resources. Because the Finder treats most bundles as opaque entities, it is difficult for casual users to move or delete the resources an application might need.

The Information Property List File

For the Finder to recognize an application bundle as such, you need to include an information property list (Info.plist) file. This file contains XML property-list data that identifies the configuration of your bundle. For a minimal bundle, this file would contain very little information, most likely just the name and identifier of the bundle. For more complex bundles, the Info.plist file includes much more information.

Important: Bundle resources are located using a case-sensitive search. Therefore, the name of your information property list file must start with a capital “I”.

Table 2-6 lists the keys that you should always include in your Info.plist file. Xcode provides all of these keys automatically when you create a new project. (Xcode obscures actual key names by default, so the string displayed by Xcode is also listed in parenthesis. You can see the real key names for all keys by Control-clicking the Information Property List key in the editor and choosing Show Raw Keys/Values from the contextual menu that appears.)

Table 2-6 Expected keys in the Info.plist file

Key

Description

CFBundleName (Bundle name)

The short name for the bundle. The value for this key is usually the name of your application. Xcode sets the value of this key by default when you create a new project.

CFBundleDisplayName (Bundle display name)

The localized version of your application name. You typically include a localized value for this key in an InfoPlist.strings files in each of your language-specific resource directories.

CFBundleIdentifier (Bundle identifier)

The string that identifies your application to the system. This string must be a uniform type identifier (UTI) that contains only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) characters. The string should also be in reverse-DNS format. For example, if your company’s domain is Ajax.com and you create an application named Hello, you could assign the string com.Ajax.Hello as your application’s bundle identifier.

The bundle identifier is used in validating the application signature.

CFBundleVersion (Bundle version)

The string that specifies the build version number of the bundle. This value is a monotonically increased string, comprised of one or more period-separated integers. This value can correspond to either released or unreleased versions of the application. This value cannot be localized.

CFBundlePackageType (Bundle OS Type code)

The type of bundle this is. For applications, the value of this key is always the four-character string APPL.

CFBundleSignature (Bundle creator OS Type code)

The creator code for the bundle. This is a four-character string that is specific to the bundle. For example, the signature for the TextEdit application is ttxt.

CFBundleExecutable (Executable file)

The name of the main executable file. This is the code that is executed when the user launches your application. Xcode typically sets the value of this key automatically at build time.

Table 2-7 lists the keys that you should also consider including in your Info.plist file.

Table 2-7 Recommended keys for the Info.plist file

Key

Description

CFBundleDocumentTypes (Document types)

The document types supported by the application. This type consists of an array of dictionaries, each of which provides information about a specific document type.

CFBundleShortVersionString (Bundle versions string, short)

The release version of the application. The value of this key is a string comprised of three period-separated integers.

LSMinimumSystemVersion (Minimum system version)

The minimum version of macOS required for this application to run. The value for this key is a string of the form n.n.n where each n is a number representing either the major or minor version number of macOS that is required. For example, the value 10.1.5 would represent macOS v10.1.5.

NSHumanReadableCopyright (Copyright (human-readable))

The copyright notice for the application. This is a human readable string and can be localized by including the key in an InfoPlist.strings file in your language-specific project directories.

NSMainNibFile (Main nib file base name)

The nib file to load when the application is launched (without the .nib filename extension). The main nib file is an Interface Builder archive containing the objects (main window, application delegate, and so on) needed at launch time.

NSPrincipalClass (Principal class)

The entry point for dynamically loaded Objective-C code. For an application bundle, this is almost always the NSApplication class or a custom subclass.

The exact information you put into your Info.plist file is dependent on your bundle’s needs and can be localized as necessary. For more information on this file, see Runtime Configuration Guidelines.

The Resources Directory

The Resources directory is where you put all of your images, sounds, nib files, string resources, icon files, data files, and configuration files among others. The contents of this directory are further subdivided into areas where you can store localized and nonlocalized resource files. Non-localized resources reside at the top level of the Resources directory itself or in a custom subdirectory that you define. Localized resources reside in separate subdirectories called language-specific project directories, which are named to coincide with the specific localization.

The best way to see how the Resources directory is organized is to look at an example. Listing 2-4 shows a fictional application that includes both localized and nonlocalized resources. The nonlocalized resources include Hand.tiff, MyApp.icns and the contents of the WaterSounds directory. The localized resources include everything in the en.lproj and jp.lproj directories or their subdirectories.

Listing 2-4 A Mac app with localized and nonlocalized resources

Each of your language-specific project directories should contain a copy of the same set of resource files, and the name for any single resource file must be the same across all localizations. In other words, only the content for a given file should change from one localization to another. When you request a resource file in your code, you specify only the name of the file you want. The bundle-loading code uses the current language preferences of the user to decide which directories to search for the file you requested.

For information about finding resource files in your application bundle, see Accessing a Bundle's Contents. For information about how to load resource files and use them in your program, see Resource Programming Guide.

The Application Icon File

One special resource that belongs in your top-level Resources directory is your application icon file. By convention, this file takes the name of the bundle and an extension of .icns; the image format can be any supported type, but if no extension is specified, the system assumes .icns.

Localizing the Information Property List

Because some of the keys in an application’s Info.plist file contain user-visible strings, macOS provides a mechanism for specifying localized versions of those strings. Inside each language-specific project directory, you can include an InfoPlist.strings file that specifies the appropriate localizations. This file is a strings file (not a property list) whose entries consist of the Info.plist key you want to localize and the appropriate translation. For example, in the TextEdit application, the German localization of this file contains the following strings:

F Minus 1 (automatonvx) Mac Os Update

Creating an Application Bundle

The simplest way to create an application bundle is using Xcode. All new application projects include an appropriately configured application target, which defines the rules needed to build an application bundle, including which source files to compile, which resource files to copy to the bundle, and so on. New projects also include a preconfigured Info.plist file and typically several other files to help you get started quickly. You can add any custom files as needed using the project window and configure those files using the Info or Inspector windows. For example, you might use the Info window to specify custom locations for resource files inside your bundle.

For information on how to configure targets in Xcode, see Xcode Build System Guide.

Framework Bundles

A framework is a hierarchical directory that encapsulates a dynamic shared library and the resource files needed to support that library. Frameworks provide some advantages over the typical dynamic shared library in that they provide a single location for all of the framework’s related resources. For example, most frameworks include the header files that define the symbols exported by the framework. Grouping these files with the shared library and its resources makes it easier to install and uninstall the framework and to locate the framework’s resources.

Just like a dynamic shared library, frameworks provide a way to factor out commonly used code into a central location that can be shared by multiple applications. Only one copy of a framework’s code and resources reside in-memory at any given time, regardless of how many processes are using those resources. Applications that link against the framework then share the memory containing the framework. This behavior reduces the memory footprint of the system and helps improve performance.

Note: Only the code and read-only resources of a framework are shared. If a framework defines writable variables, each application gets its own copy of those variables to prevent it from affecting other applications.

Although you can create frameworks of your own, most developers’ experience with frameworks comes from including them in their projects. Frameworks are how macOS delivers many key features to your application. The publicly available frameworks provided by macOS are located in the /System/Library/Frameworks directory. In iOS, the public frameworks are located in the System/Library/Frameworks directory of the appropriate iOS SDK directory. For information about adding frameworks to your Xcode projects, see Xcode Build System Guide.

Note: The creation of custom frameworks is not supported in iOS.

For more detailed information about frameworks and framework bundles, see Framework Programming Guide.

Anatomy of a Framework Bundle

The structure of framework bundles differs from that used by applications and plug-ins. The structure for frameworks is based on a bundle format that predates macOS and supports the inclusion of multiple versions of the framework’s code and resources in the framework bundle. This type of bundle is known as a versioned bundle. Supporting multiple versions of a framework allows older applications to continue running even as the framework shared library continues to evolve. The bundle’s Versions subdirectory contains the individual framework revisions while symbolic links at the top of the bundle directory point to the latest revision.

The system identifies a framework bundle by the .framework extension on its directory name. The system also uses the Info.plist file inside the framework’s Resources directory to gather information about the configuration of the framework. Listing 2-5 shows the basic structure of a framework bundle. The arrows (->) in the listing indicate symbolic links to specific files and subdirectories. These symbolic links provide convenient access to the latest version of the framework.

Listing 2-5 A simple framework bundle

Frameworks are not required to include a Headers directory but doing so allows you to include the header files that define the framework’s exported symbols. Frameworks can store other resource files in both standard and custom directories.

Creating a Framework Bundle

If you are developing software for macOS, you can create your own custom frameworks and use them privately or make them available for other applications to use. You can create a new framework using a separate Xcode project or by adding a framework target to an existing project.

For information about how to create a framework, see Framework Programming Guide.

Loadable Bundles

Plug-ins and other types of loadable bundles provide a way for you to extend the behavior of an application dynamically. A loadable bundle consists of executable code and any resources needed to support that code stored in a bundle directory. You can use loadable bundles to load code lazily into your application or to allow other developers to extend the basic behavior of your application.

Note: The creation and use of loadable bundles is not supported in iOS.

Anatomy of a Loadable Bundle

Loadable bundles are based on the same structure as application bundles. At the top-level of the bundle is a single Contents directory. Inside this directory are several subdirectories for storing executable code and resources. The Contents directory also contains the bundle’s Info.plist file with information about the bundle’s configuration.

Unlike the executable of an application, loadable bundles generally do not have a main function as their main entry point. Instead, the application that loads the bundle is responsible for defining the expected entry point. For example, a bundle could be expected to define a function with a specific name or it could be expected to include information in its Info.plist file identifying a specific function or class to use. This choice is left to the application developer who defines the format of the loadable bundle.

Listing 2-6 shows the layout of a loadable bundle. The top-level directory of a loadable bundle can have any extension, but common extensions include .bundle and .plugin. macOS always treats bundles with those extensions as packages, hiding their contents by default.

Listing 2-6 A simple loadable bundle

In addition to the MacOS and Resources directories, loadable bundles may contain additional directories such as Frameworks, PlugIns, SharedFrameworks, and SharedSupport—all the features supported by full-fledged application packages.

The basic structure of a loadable bundle is the same regardless of which language that bundle uses in its implementation. For more information about the structure of loadable bundles, see Code Loading Programming Topics.

Creating a Loadable Bundle

If you are developing software for macOS, you can create your own custom loadable bundles and incorporate them into your applications. If other applications export a plug-in API, you can also develop bundles targeted at those APIs. Xcode includes template projects for implementing bundles using either C or Objective-C, depending on the intended target application.

For more information about how to design loadable bundles using Objective-C, see Code Loading Programming Topics. For information about how to design loadable bundles using the C language, see Plug-in Programming Topics.

Localized Resources in Bundles

Within the Resources directory of a macOS bundle (or the top-level directory of an iOS application bundle), you can create one or more language-specific project subdirectories to store language- and region-specific resources. The name of each directory is based on the language and region of the desired localization followed by the .lproj extension. To specify the language and region, you use the following format:

  • language_region.lproj

The language portion of the directory name is a two-letter code that conforms to the ISO 639 conventions. The region portion is also a two-letter code but it conforms to the ISO 3166 conventions for designating specific regions. Although the region portion of the directory name is entirely optional, it can be a useful way to tune your localizations for specific parts of the world. For example, you could use a single en.lproj directory to support all English speaking nations. However, providing separate localizations for Great Britain (en_GB.lproj), Australia (en_AU.lproj), and the United States (en_US.lproj) lets you tailor your content for each of those countries.

Note: For backwards compatibility, the NSBundle class and CFBundleRef functions also support human-readable directory names for several common languages, including English.lproj, German.lproj, Japanese.lproj, and others. Although the human-readable names are supported, the ISO names are preferred.

If most of your resource files are the same for all regions of a given language, you can combine a language-only resource directory with one or more region-specific directories. Providing both types of directories alleviates the need to duplicate every resource file for each region you support. Instead, you can customize only the subset of files that are needed for a particular region. When looking for resources in your bundle, the bundle-loading code looks first in any region-specific directories, followed by the language-specific directory. And if neither localized directory contains the resource, the bundle-loading code looks for an appropriate nonlocalized resource.

Important: Do not store code in your lproj folders, because the system does not load or execute code stored in lproj folders. To learn more about where code and other types of data should be stored in your app bundle, see macOS Code Signing In Depth.

Listing 2-7 shows the potential structure of a Mac app that contains both language- and region-specific resource files. (In an iOS application, the contents of the Resources directory would be at the top-level of the bundle directory.) Notice that the region-specific directories contain only a subset of the files in the en.lproj directory. If a region-specific version of a resource is not found, the bundle looks in the language-specific directory (in this case en.lproj) for the resource. The language-specific directory should always contain a complete copy of any language-specific resource files.

Listing 2-7 A bundle with localized resources

For more information on language codes and the process for localizing resources, see Internationalization and Localization Guide.



Copyright © 2017 Apple Inc. All Rights Reserved. Terms of Use Privacy Policy Updated: 2017-03-27

F Minus 1 (automatonvx) Mac OS

Leave a Reply

Cancel reply