From a361d50b959f8889ebdd356e7bd22560b1dfb0ec Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 19 May 2016 10:57:57 +0900 Subject: [PATCH 1/2] Add team ID to base Bundle ID --- atom/app/atom_main_delegate_mac.mm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/atom/app/atom_main_delegate_mac.mm b/atom/app/atom_main_delegate_mac.mm index b26d5f46f644..ea5ab320a4d0 100644 --- a/atom/app/atom_main_delegate_mac.mm +++ b/atom/app/atom_main_delegate_mac.mm @@ -10,6 +10,7 @@ #include "base/mac/foundation_util.h" #include "base/mac/scoped_nsautorelease_pool.h" #include "base/path_service.h" +#include "base/strings/sys_string_conversions.h" #include "brightray/common/application_info.h" #include "brightray/common/mac/main_application_bundle.h" #include "content/public/common/content_paths.h" @@ -52,8 +53,13 @@ void AtomMainDelegate::OverrideChildProcessPath() { void AtomMainDelegate::SetUpBundleOverrides() { base::mac::ScopedNSAutoreleasePool pool; - NSBundle* base_bundle = brightray::MainApplicationBundle(); - base::mac::SetBaseBundleID([[base_bundle bundleIdentifier] UTF8String]); + NSBundle* bundle = brightray::MainApplicationBundle(); + std::string base_bundle_id = + base::SysNSStringToUTF8([bundle bundleIdentifier]); + NSString* team_id = [bundle objectForInfoDictionaryKey:@"ElectronTeamID"]; + if (team_id) + base_bundle_id = base::SysNSStringToUTF8(team_id) + "." + base_bundle_id; + base::mac::SetBaseBundleID(base_bundle_id.c_str()); } } // namespace atom From 5d906c0e4ed60512396c865f50dda89505d9ad88 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 19 May 2016 11:13:09 +0900 Subject: [PATCH 2/2] docs: Team ID is now required for signing --- .../mac-app-store-submission-guide.md | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/docs/tutorial/mac-app-store-submission-guide.md b/docs/tutorial/mac-app-store-submission-guide.md index 75ebb0776581..28c5ab64f120 100644 --- a/docs/tutorial/mac-app-store-submission-guide.md +++ b/docs/tutorial/mac-app-store-submission-guide.md @@ -19,14 +19,33 @@ how to meet the Mac App Store requirements. To submit your app to the Mac App Store, you first must get a certificate from Apple. You can follow these [existing guides][nwjs-guide] on web. +### Get Team ID + +Before signing your app, you need to know the Team ID of your account. To locate +your Team ID, Sign in to https://developer.apple.com/account/, and click +Membership in the sidebar. Your Team ID appears in the Membership Information +section under the team name. + ### Sign Your App -After getting the certificate from Apple, you can package your app by following +After finishing the preparation work, you can package your app by following [Application Distribution](application-distribution.md), and then proceed to -signing your app. This step is basically the same with other programs, but the -key is to sign every dependency of Electron one by one. +signing your app. -First, you need to prepare two entitlements files. +First, you have to add a `ElectronTeamID` key to your app's `Info.plist`, which +has your Team ID as key: + +```xml + + + ... + ElectronTeamID + TEAM_ID + + +``` + +Then, you need to prepare two entitlements files. `child.plist`: @@ -53,15 +72,13 @@ First, you need to prepare two entitlements files. com.apple.security.app-sandbox com.apple.security.application-groups - - your.bundle.id - + TEAM_ID.your.bundle.id ``` -_You have to replace `your.bundle.id` with the Bundle ID specified in your app's -`Info.plist`._ +You have to replace `TEAM_ID` with your Team ID, and replace `your.bundle.id` +with the Bundle ID of your app. And then sign your app with the following script: