- Computer Programming/MacOS Programming
- Contents
- About the platform [ edit | edit source ]
- Types of Software for Mac OS X [ edit | edit source ]
- Applications [ edit | edit source ]
- AppleScripts [ edit | edit source ]
- Automator Workflows [ edit | edit source ]
- Shell Scripts [ edit | edit source ]
- Command Line Tools [ edit | edit source ]
- Java [ edit | edit source ]
- Python [ edit | edit source ]
- Ruby [ edit | edit source ]
- Websites [ edit | edit source ]
- Mac OS X Specific Languages [ edit | edit source ]
- Membership Details
- Software and Tools
- Beta OS Releases
- Tools
- Services and Capabilities
- Distribution
- App Store
- Apple Business Manager and Apple School Manager
- Ad Hoc
- Developer ID
- Events and Support
Computer Programming/MacOS Programming
Contents
About the platform [ edit | edit source ]
macOS is the primary operating system for the Macintosh computer. It was originally a system designed privately by Apple Inc, however with Mac OS X, it has been based on Unix. Specifically, a modified FreeBSD operating system called «Darwin».
There are many different kinds of software that can be developed for Mac OS X. People generally think of applications, but we’ll briefly cover some of the other kinds.
Types of Software for Mac OS X [ edit | edit source ]
Applications [ edit | edit source ]
Applications are what people generally think of when they think about software for Mac OS X. Cocoa applications include: Finder, Mail, Address Book, Safari, Microsoft Word, and Microsoft Excel. Anybody can develop applications using Apple’s free development tools which includes XCode. Mac OS X applications are developed using Objective-C though there are other possible programming languages that could be used.
The most popular languages for use on the macOS platform is Objective-C which could be thought of as Mac OS X’s «native language» since the Mac OS X libraries, or «frameworks», all have an Objective-C interface. Objective-C includes everything that plain C can do, and adds object-oriented programming. See: Objective-C.
C++ can be used in developing for the Mac, but generally, it is used in addition to Objective-C rather than being in place of Objective-C. Using both Objective-C and C++ is called «Objective-C++» and is considered to be optional when developing software for Mac OS X: C++
See Programming:Objective-C for a lesson on the basics of Objective-C [1] may also be of assistance.
Some preliminary thoughts:
Objective-C is the language most commonly used in Mac OS Programming. Objective-C entered Mac OS X and has ancestry in NeXT. Cocoa. Before you learn Mac programming you must know the basics of C since it is the basis for Objective-C.
There used to be three separate APIs for developing a Mac application with a GUI:
1. Classic (Mac OS 9 and lower). Developing for the Classic API is no longer done. When Mac OS X first came out, users and developers had a huge investment in software written for Mac Classic OS and Mac OS X used to have an emulation mode so that users could run their old software. Apple has long since stopped support of the Classic API and Classic emulation in Mac OS X.
2. Carbon (Mac OS 8.5 up to and including Mac OS X 10.6 Snow Leopard). Carbon was an API for developers to update their applications that used the Classic API to be run without the Classic emulator. Carbon was a great way that Apple provided developers to upgrade their software to run on Mac OS X without having to totally rewrite their software, but Carbon, like Classic, is no longer supported by Apple.
3. Cocoa (All versions of Mac OS X). Cocoa is the most native API that can be used to develop applications for Mac OS X that are truly «Mac-like». Generally, Objective-C will be used along with Cocoa, though there are other options such as Cocoa-AppleScript and Cocoa-Python, but Cocoa-Objective-C is really the «mainstream» way to develop Cocoa applications.
Resource Forks Files in Mac OS X have a feature that is unique to Mac OS and that is that each file on disk can have two «forks». This feature used to be used for Classic and Carbon applications to separate code from resources (such as menus, windows, etc.), and the Mac OS X file system still supports two forks, but you should only use the «data fork». The resource fork is non-standard and can be lost when transferring Mac files to other file systems.
AppleScripts [ edit | edit source ]
Another «native language» for developing Mac OS X applications is AppleScript. AppleScript is a language that Apple invented to automate repetitive tasks. The AppleScript application is located on your Mac at /Applications/Utilities/AppleScript Editor. AppleScript can be used to record AppleEvents, the events that applications send to themselves or to other applications. Why don’t you try it out. Open AppleScript Editor, press the record button, do some things with your other applications and watch the script write itself. AppleScript can be used alone or it can be used along with XCode to develop Cocoa Applications using mostly AppleScript instead of Objective-C. This option is mostly for experienced AppleScript programmers who don’t know Objective-C.
Automator Workflows [ edit | edit source ]
Apple also provides an application called «Automator» that can be used to easily automate repetitive tasks. It is located at /Applications/Automator.app
Shell Scripts [ edit | edit source ]
Mac OS X has an application called Terminal that provides a command-line interface to Mac OS X. It is possible to develop scripts for the command line. Terminal.app is located at /Applications/Utilities/Terminal.app To create a shell script, you need a text editor. There is a text editor that comes with Mac OS X called «TextEdit.app». It is located in /Applications/TextEdit.app. But actually, what is better than TextEdit is a program such as TextWrangler.app which is available for free from the following link: http://www.barebones.com/products/textwrangler/
The shell that Terminal.app uses by default is called «bash». Here is a simple tutorial on developing bash scripts http://www.maclife.com/article/columns/terminal_101_automate_terminal_bash_scripts
We won’t go any more deeply into shell scripts here in this wikibook, but it’s just good to know what they are. You can always google for more information now that you know what to google for.
Command Line Tools [ edit | edit source ]
When you open Terminal and you learn how to type in commands. The commands are usually command-line tools or scripts. Above, we just talked about developing your own scripts with a text editor. It’s also possible to develop your own command-line tools, using XCode. This is an advanced thing to do. Usually, power-users will write a shell-script (or some other kind of thing such as an AppleScript or an Automator Workflow) but it’s good to know what a command-line tool is. Command-line tools have a textual user-interface rather than a graphical user interface (GUI).
Java [ edit | edit source ]
Java used to be treated by Apple as a «first class language» to develop for Mac OS, however in recent years, Apple has less support for Java. Now with Mac OS X 10.7 «Lion» and 10.8 «Mountain Lion», Java doesn’t even come pre-installed in Mac OS X. Java is still available, but users have to download Java from Oracle’s website and install it themselves. Apple’s Mac App Store doesn’t even allow Java apps to be sold at their store calling Java «deprecated».
However, there still are Mac developers who use Java because it has the advantage of being cross-platform compatible. For example, the same source-code can be used to generate software that runs on Mac, Windows, and Linux.
Apple has said that Java reduces the Mac to the «least common denominator». That’s why they support it less.
Python [ edit | edit source ]
Python is somewhat supported by Apple. In fact, Python is shipped with Mac OS X and is part of the System Folder. There are third-party libraries that allow developers to develop applications using Python and Cocoa together, but these are not very well maintained, and Python on the Mac is most suitable for developing command-line utilities, or cross-platform scripts that aren’t really very Mac-like.
Ruby [ edit | edit source ]
Similar to Python.
Websites [ edit | edit source ]
Most Mac users use Safari for their web browser. Safari uses the standards set by w3c.org You can develop websites that work with Safari by following the standards of the w3c.org. Remember to validate your HMTL, CSS, and JavaScript.
If you’re developing websites using your Mac and using Safari, remember to test your webpages on other platforms and with other web browsers.
Mac OS X Specific Languages [ edit | edit source ]
Objective-C is really the «native» language for Mac OS X development
You could call AppleScript a «native» language too, but it isn’t really used to make commercial applications. It was designed to be used by real power-users to automate their tasks. Although it is possible to use AppleScript to build Cocoa applications in XCode, this would be more for users who already know AppleScript and don’t want to learn Objective-C.
Источник
Membership Details
Membership includes all the tools, resources, and support you need to create and deliver software to over a billion customers around the world on Apple platforms.
Software and Tools
Beta OS Releases
Download and install beta versions of operating systems so your apps will be ready for the latest public releases.
- iOS beta
- iPadOS beta
- macOS beta
- watchOS beta
- tvOS beta
Tools
Gain full access to a comprehensive set of tools to configure app services, manage your development teams, and submit new apps and updates.
Xcode
The Xcode integrated development environment (IDE) includes everything you need to build and upload apps for iPhone, iPad, Mac, Apple TV, and Apple Watch.
App Store Connect
Easily submit and manage your apps on the App Store.
- Create App Store product pages.
- Test apps with TestFlight by inviting up to 10,000 external testers using a public link or their email address.
- Submit apps for review.
- Create promotional offers and promo codes.
- Set up pricing, subscriptions, and availability.
- Offer pre-orders and app bundles.
- Get app thinning and up to 20GB of on-demand asset storage per app.
- Manage your team.
- Respond to reviews.
- View app analytics to measure your app’s performance with data you won’t find anywhere else.
- View sales and trends.
- View and download payments and financial reports.
- Access App Store Connect tools with a REST API.
Transporter
Easily upload your binary to App Store Connect.
Certificates, Identifiers & Profiles
Enable development, distribution, and services for your app.
CloudKit Dashboard
Get a detailed view of your app’s server activity with CloudKit.
Create ML
Build, train, and deploy machine learning models with no machine learning expertise required.
MapKit JS Dashboard
Track your website’s use of Apple Maps services.
Reality Composer
Quickly prototype and produce content for AR experiences.
Reality Converter
Convert, view, and customize USDZ 3D objects on Mac.
Snapshots Studio (beta)
Customize static map images for your website.
SF Symbols
Choose from thousands of configurable symbols for use in your apps.
Classroom and Schoolwork
Test your educational apps that work with the Classroom and Schoolwork apps.
And more.
Services and Capabilities
Build your apps with a comprehensive set of services and capabilities that let you deliver advanced features to your users. Apple hardware, software, and services integrate tightly so you can build intuitive, multi-faceted experiences that are genuinely seamless.
AirPlay
Let users wirelessly stream content from their iPhone, iPad, or Mac.
AirPrint
Deliver photo and document printing in your iOS apps and macOS apps without the need to download or install drivers.
App Clips
Let users start and finish an experience of your app in seconds.
Apple Pay
Accept payments for goods and services in your apps and on the web.
ARKit
Build unparalleled augmented reality experiences for iOS and iPadOS.
Messages for Business
Connect with your business customers directly within Messages.*
CarPlay
Bring audio, messaging, VoIP, navigation, vehicle-specific controls, and more to drivers.*
CloudKit
Store your app’s data in iCloud and keep everything up to date across apps and on the web. Membership includes up to 1PB of free storage for each app.
Core ML
Integrate a broad variety of machine learning model types into your app.
Face ID and Touch ID
Let users access your app content easily and securely.
FairPlay Streaming
Content providers, encoding vendors, and delivery networks can encrypt content, securely exchange keys, and protect playback on iOS, tvOS, and macOS.*
GameKit
Add leaderboards, achievements, matchmaking, challenges, and more.
Handoff
Provide continuity for users with multiple devices by supporting Handoff in your apps and websites.
HealthKit
Deliver informed health and fitness solutions.
HomeKit
Allow users to communicate with and control connected accessories in their home.
In-App Purchase and Subscriptions
Offer customers extra content and features within your app with StoreKit.
Mac Catalyst
Build a native Mac app using the Xcode project of your current iPad app.
MapKit
Integrate Apple Maps into your apps and websites.
MusicKit
Let users play Apple Music and their local music library from your website and iOS or Android apps.
Network Extensions
Customize and extend core networking features of iOS and Mac.
PassKit
Let users view passes in your app, add them to Wallet, send them via email, or post them on the web.
Push Notifications
Send local and push notifications to keep users informed of timely and relevant content.
SiriKit and Shortcuts
Help users quickly accomplish tasks related to your app with their voice or with a tap.
Sign in with Apple
Let users sign in to your apps and websites using their Apple ID.
ResearchKit and CareKit
Create apps that deliver medical insights for researchers, doctors, and patients.
System Extensions and DriverKit
Provide additional capabilities, such as network extensions and endpoint security, create device drivers for Mac.
Widgets
Deliver a small amount of timely, useful information or app-specific functionality across iOS, iPadOS, and macOS.
And more.
Distribution
App Store
The App Store makes it easy for over a billion customers on iPhone, iPad, Mac, Apple TV, and Apple Watch to discover and download your apps, games, and sticker packs. And with Apple Arcade on the App Store, you can be a part of a game subscription service unlike any other*.
- Reach customers in 175 regions.
- Keep 70% of your sales proceeds (85% if you’re enrolled in the App Store Small Business Program or News Partner Program) and 85% for qualifying subscriptions.
- No hosting fees.
- Worldwide payment processing is handled by Apple. Users can pay with credit or debit cards, carrier billing, digital wallets, or App Store and iTunes gift cards, depending on their region.
- Submit an unlimited number of apps and updates.
- Be considered for featuring in an editorial list or story.
- Automatic updates let users opt in to always download the latest version of your apps.
- Have your in-app purchase hosted by Apple for a seamless user experience, and easy distribution and restoration of purchases.
Apple Business Manager and Apple School Manager
All apps on the App Store are also available in volume for businesses and educational institutions in select regions.
- Choose to provide a discount for educational institutions.
- Privately offer custom apps you’ve made for specific organizations.
- Organizations can also privately distribute their proprietary apps to employees.
Ad Hoc
A limited number of users can install your app directly on their Apple devices for testing and internal distribution.
- iPhone (100 per membership year)
- iPad (100 per membership year)
- iPod touch (100 per membership year)
- Apple Watch (100 per membership year)
- Apple TV (100 per membership year)
Developer ID
Distribute your Mac apps, plug-ins, and installer packages outside of the Mac App Store by signing them with a Developer ID certificate and having them notarized by Apple. This lets Gatekeeper on macOS verify that your software is from a trusted developer and is safe to install.
Events and Support
Developer Events
Learn how to take your apps to the next level with technical details and guidance from Apple experts at events for program members.**
Technical Support
Request code-level support from technical support engineers who can help troubleshoot your app’s code or provide solutions that will fast-track your development. Two incidents per membership year are included. Any member of a team can purchase additional support for $99 (or in local currency where available) per two incidents.
Developer Forums
Ask questions and respond to posts on developing for Apple platforms with Apple engineers and other developers.
Membership Support
Get help by phone or email on account management, tools, and distribution, at no cost.
Источник