Working with Targets
Every project contains at least one target. A target specifies a product to build, such as an iOS, watchOS, or OS X app. Select a target in the project editor to view and modify the target's settings. In the screenshot below, the Adventure iOS target of the Adventure project is selected in the project navigator, and the Adventure iOS target is selected in the project editor. The project editor displays the General pane for the target.
OSX/Dok was targeting OS X users via an email phishing campaign. The best way to avoid falling foul to such an attempt in the future is not to respond to emails that require you to enter a. Feb 22, 2020 But to me, the most important aspect of Linux being a superior choice is its Open Source nature. And, most of the points discussed below are the direct advantages of an Open Source software. To briefly explain, you get to see/modify the source code yourself if it is an open source software. But, for Mac, Apple gets an exclusive control.
Applying App-Specific Target Settings
The General pane for a target shows basic settings that you occasionally check and possibly edit. You typically assign values for these settings elsewhere during the app development process, for example, in dialogs that appear when you create a new project.
For an iOS app, the General pane contains target settings for:
The bundle identifier, a string that identifies the app to the operating system and to the App Store
The version number under which to publish the app
The build number, which identifies a particular build of the app
The name of your Apple Developer Program development team
The deployment target, which is the earliest iOS version on which the app runs
The devices for which to build the app
The main user interface file to load when the app launches
The user interface orientations (portrait, upside down, landscape left, landscape right) that the app supports
For a watchOS app, the General pane contains target settings for:
The display name of the app
The bundle identifier
The version number
The build number
The source for the app icon
For a WatchKit extension, the General pane contains target settings for:
Targeting Change Mac Os Icon
The bundle identifier
The version number
The build number
The complication configuration including data source class, supported families, and groups
A list of embedded binaries
A list of linked frameworks and libraries
Possibly other information depending on what the extension does
For an OS X app, the General pane contains target settings for:
The application category, for classifying the app on the Mac App Store
The bundle identifier
The version number
The build number
An option to code sign the app for the Mac App Store, to code sign the app with a developer ID for distribution outside the Mac App Store, or to leave the code unsigned
The deployment target, which is the earliest OS X version on which the app will run
The icon that OS X uses to identify the app to the user
Specifying debug or release builds is done elsewhere. See Managing Schemes.
Adding Technology Features to a Target
To add various Apple technologies—such as iCloud, Game Center, In-App Purchase, and Maps—to your app, select its target in the project editor and click Capabilities. Add a capability by setting a switch to On. Xcode adds the necessary entitlements file to your project and links the target to the necessary frameworks. In some cases, Xcode might encounter issues enabling a capability. If so, that information will be displayed in the information area for that capability.
You can show or hide detail for a capability by clicking the disclosure triangle to the left of the capability name. For capabilities that are off, this area describes the capability and actions that occur when the capability is turned on. For capabilities that are on, use this area to view or update any associated configuration and to identify issues that need fixing.
For more information on adding capabilities, see Adding Capabilities.
Adding On-Demand Resource Tags to a Target
On-demand resources are app contents that you download only when needed. They are hosted on the App Store separately from the app bundle downloaded by the user. You can use on-demand resources to enable smaller apps, faster downloads, and richer app content. You use tags to identify and manage the on-demand resources in a target.
The Resource Tags pane shows the list of tags and the associated resources. You can use it to add and remove tags as well as to move resources between tags.
For more information on adding and using on-demand resources, see On-Demand Resources Guide.
Adding File Type and Service Information to a Target
The Info pane for a target shows properties associated with your app, file types that your app can create or open, and for OS X, services provided by your app. Most of the custom target properties are modified in other parts of the Xcode interface (such as the bundle identifier, version, and build number set in the General pane). The screenshot shows the Info pane for the iOS target of the Adventure app.
The Document Types setting specifies the document types you can create and edit in your app and provides a custom icon displayed for that document type by iOS or the Mac OS.
Add exported and imported UTIs for any file types your app can export or import. Unlike document types, which are usually unique to your app, UTIs specify general formats like plain text or .png
. For example, UTIs support copying and pasting to and from the Clipboard between apps. See Uniform Type Identifiers Reference for more information and a list of supported types.
The URL Types setting lets you specify custom schemas for exchanging data with other apps by using custom protocols. For example, some existing schemas include http
, mailto
, and sms
. For more information, see Using URL Schemes to Communicate with Apps (iOS) or Launch Services Programming Guide (Mac OS).
Mac OS apps use the Services item to add items that appear in the Services menu. For more information, see Services Implementation Guide.
Overriding Build Settings for a Target
A target contains instructions—in the form of build settings and build phases—for building a product. A target inherits the project's build settings. Although most developers seldom need to change these settings, you can override any of the project's build settings by specifying different settings at the target level. Select a target in the project editor to modify the target settings in the Info, Build Settings, or Build Phases pane.
Copyright © 2018 Apple Inc. All rights reserved. Terms of Use | Privacy Policy | Updated: 2016-10-27
│English (en) │
This article applies to Mac OS Classic only.
See also: Multiplatform Programming Guide
MacOS is the target for Mac OS Classic, i.e. the predecessor to macOS. macOS itself was previously marketed as Mac OS X and OS X. For macOS, see Target Darwin.
- 2Some tips
- 5Cross compiling from Mac OS X to Mac OS
Compiling in MPW
Free Pascal can now be used in the MPW development environment.
Free Pascal for MPW call assembler and linker via ToolServer. This means that you need ToolServer installed. This will normally not be an issue, since ToolServer is included in the MPW distribution.
In rare instances, you might get the error message 'Can't call the assembler, switching to external assembler.' I do not know the origin of this, but it will help to restart. On Mac OS X you might need to restart even OSX. It might also indicate that you need to increase the memory setting for ToolServer.
Another workaround for such problems is to let the compiler write out an MPW script (option -s). This will assemble and link when executed in MPW. This method can also be used if the compiler is to be called from a third program, to overcome the deadlock situation mentioned below under Dos.Exec.
For crosscompiling e.g. from macOS to Mac OS Classic, see below.
Some tips
Choosing apptype
For casual users, copying Pascal text only programs from a book, {$APPTYPE CONSOLE}
is appropriate.
If you want an MPW tool, use {$APPTYPE TOOL}
.
For maximum portability, the following:
... ensures it will be an MPW tool on Mac OS, and a console application in Delphi where {$APPTYPE TOOL} is not recognized.
Resources
Since 24-01-2004 mac style resources can be included with {$R }
. If the resource file ends with .r it is considered a Rez type resource file (in text form). For all other files (including .rsrc), binary resources are assumed. Several resource files can be included.
Error messages
Mac Os Change Folder Color
Errors, warnings, hints and other messages written by the compiler are in MPW format - that is you can execute them and the error location will be displayed.
Dos.Exec
The procedure Dos.Exec is used to execute other programs. In MacOS this is supported, and the program(s?) which can be executed is MPW tools. An AppleEvent is sent to ToolServer which in turn executes the tool. A limitation is that ToolServer is not reentrant, so if a program which is called via Dos.Exec, in turn call Dos.Exec, it will be deadlocked.
Assembler symbols
Internal symbols in the generated assembler files will have a lowercase 's' as part separator instead of '$'. The reason is that PPCAsm does not support $.
QuickDraw globals
There is a variable qd defined in System.pp for use as the QuickDraw global.
For {$APPTYE TOOL}
and {$APPTYPE CONSOLE}
it is initialized, but for {$APPTYPE GUI}
you have to initialize it yourself.
Debugging
See MPW debugging
Global variables
Currently all global variables are indirect, i.e. the entry in the TOC is always a pointer to data. (In the future small data items may be stored directly in the TOC)
Thus all references to globals are via a construct like: lwz rX, yyy[TC](r2) ;loads a pointer to a global into rX
Cross compiling from Mac OS X to Mac OS
Although not necessary nowadays when there exists a native compiler for target MacOS, here is some info on how to cross compile. See also Link on target.
Crosscompiling step on macOS
When compiling, add these options:
If make is used, add OPT=-st OS_TARGET=macos
Note that one must first build the RTL by issuing make
in rtl/macos, with the above options, to be able to build other programs. The RTL must then be assembled and linked (see below) before compiling any program, otherwise the search paths in the link script will not be correct.
You might also want to add option -a, then the link script will not delete unneeded files, in particular the assembler files (*.s). This can be useful if there are problems with the link scripts and you want to rerun it.
Assembling and linking step on Mac OS Classic
In case that host and target machine is different, transfer the produced files (assembler files (*.s) and link script *_ppas) to the host.
In Mac OS Classic, use MPW to assemble and link the output from FreePascal by executing the link script (which is an MPW script), with its directory as current directory. Unfortunately the link script does not(?) obtain the proper mac file type, so this has to be fixed first e.g. with the MPW command SetFile.
Example: To build Hello World (together with the rtl unit system.pp), execute:
Above circa 2004/5.
Working notes: situation as of late 2012
The objective here is to build PPC and possibly 68K compilers, first as cross-compilers to run on a PC and then to run natively on Mac OS 9. Part of the incentive for this is to investigate whether a PPC Mac, e.g. my (MarkMLl) G3 beige with 'Old World' ROMs, is a usable testbed for the fixed 68K compiler which Sven has added to trunk at around 2.8.
On e.g. Debian Linux, build and install cross-binutils:
Do the same for m68k-linux-gnu.
Build a cross-compiler to run on a PC but targeting PPC:
Renaming the compiler prevents it from being deleted by make clean etc., consider extending that OPT setting with -dEXTDEBUG.
Build a native RTL and compiler:
Bringing macos/sysdir.inc up to date shows that the amiga, embedded, watcom and symbian OS targets are similarly falling behind. It's instructive to compare the amiga target (which has not been updated) with the morphos target (which has).
There's also a problem inside the compiler itself where entries of type AT_NONE are being generated but not handled.
Thus all references to globals are via a construct like: lwz rX, yyy[TC](r2) ;loads a pointer to a global into rX
Cross compiling from Mac OS X to Mac OS
Although not necessary nowadays when there exists a native compiler for target MacOS, here is some info on how to cross compile. See also Link on target.
Crosscompiling step on macOS
When compiling, add these options:
If make is used, add OPT=-st OS_TARGET=macos
Note that one must first build the RTL by issuing make
in rtl/macos, with the above options, to be able to build other programs. The RTL must then be assembled and linked (see below) before compiling any program, otherwise the search paths in the link script will not be correct.
You might also want to add option -a, then the link script will not delete unneeded files, in particular the assembler files (*.s). This can be useful if there are problems with the link scripts and you want to rerun it.
Assembling and linking step on Mac OS Classic
In case that host and target machine is different, transfer the produced files (assembler files (*.s) and link script *_ppas) to the host.
In Mac OS Classic, use MPW to assemble and link the output from FreePascal by executing the link script (which is an MPW script), with its directory as current directory. Unfortunately the link script does not(?) obtain the proper mac file type, so this has to be fixed first e.g. with the MPW command SetFile.
Example: To build Hello World (together with the rtl unit system.pp), execute:
Above circa 2004/5.
Working notes: situation as of late 2012
The objective here is to build PPC and possibly 68K compilers, first as cross-compilers to run on a PC and then to run natively on Mac OS 9. Part of the incentive for this is to investigate whether a PPC Mac, e.g. my (MarkMLl) G3 beige with 'Old World' ROMs, is a usable testbed for the fixed 68K compiler which Sven has added to trunk at around 2.8.
On e.g. Debian Linux, build and install cross-binutils:
Do the same for m68k-linux-gnu.
Build a cross-compiler to run on a PC but targeting PPC:
Renaming the compiler prevents it from being deleted by make clean etc., consider extending that OPT setting with -dEXTDEBUG.
Build a native RTL and compiler:
Bringing macos/sysdir.inc up to date shows that the amiga, embedded, watcom and symbian OS targets are similarly falling behind. It's instructive to compare the amiga target (which has not been updated) with the morphos target (which has).
There's also a problem inside the compiler itself where entries of type AT_NONE are being generated but not handled.
To be continued.