Yes — on macOS the CEF helper does not need to be named “AppName Helper.app”.
You can rename it, but the name must be configured in the app bundle structure, the build system, and each helper’s Info.plist.
It is not set in cefhost.cpp.
Below is the definitive breakdown.
Where the helper name comes from (macOS)
CEF on macOS requires three helper bundles:
MyApp.app
└─ Contents
└─ Frameworks
├─ MyApp Helper.app
├─ MyApp Helper (GPU).app
└─ MyApp Helper (Renderer).app
The names of these helper apps must match the names embedded in Info.plist entries, including:
CFBundleNameCFBundleExecutableCFBundleIdentifierLSEnvironment(for specifying the subprocess type)
Where to change the name
### 1. Xcode / CMake / GN build target name
If you use CMake (CEF standard):
set_target_properties(my_ custom_helper PROPERTIES
OUTPUT_NAME "MyCustom Helper"
)
This determines:
MyCustom Helper.app
2. Helper’s Info.plist
You must update the plist inside each helper bundle:
<key>CFBundleName</key>
<string>MyCustom Helper</string>
<key>CFBundleExecutable</key>
<string>MyCustom Helper</string>
<key>CFBundleIdentifier</key>
<string>com.mycompany.myapp. helper</string>
Each helper type also requires:
<key>LSEnvironment</key>
<dict>
<key>CEF_PROCESS_TYPE</key>
<string>renderer</string>
</dict>
(“renderer”, “gpu”, or “zygote” depending on helper.)
3. Main app’s Info.plist linking to helpers
The main app references the helpers in:
CEFSubprocessPathor the
ChromeHelpermechanism depending on version
A typical example:
<key>CEFSubprocessPath</key>
<string>Contents/Frameworks/ MyCustom Helper.app/Contents/MacOS/ MyCustom Helper</string>
NOT set in cefhost.cpp
cefhost.cpp (and other platform code in CEF) does not control helper names.
CEF simply launches whatever bundle/executable path you specify.
Summary
| Setting | Where changed |
|---|---|
| Helper app name | Build system (Xcode/CMake/GN) |
| Executable name | Info.plist (CFBundleExecutable) |
| Bundle name | Info.plist (CFBundleName) |
| Bundle identifier | Info.plist (CFBundleIdentifier) |
| CEF subprocess path | Main app’s Info.plist or CEF API call |
If you want, I can also provide:
A ready-to-use CMake configuration for custom helper names
A complete set of 3 macOS helper Info.plists
A template for an entire renamed CEF macOS bundle layout
Yes, you can rename the CEF helper application to something other than AppName Helper.app. This is common for branding or obscuring the use of CEF.
To do this, you must coordinate changes in two places: the filesystem (the actual app bundle) and the source code (CefSettings).
Step 1: Rename the Helper Bundle (File System)
You need to change the name of the helper application bundle itself and its internal executable.
Rename the Bundle: Change
YourApp Helper.apptoCustomName.appinside your main application'sContents/Frameworks/directory.Rename the Executable: Inside
CustomName.app/Contents/MacOS/, rename the executable binary from YourApp HelpertoCustomName.Update Info.plist: Open
CustomName.app/Contents/Info.and update these keys to match your new name:plist CFBundleName:CustomNameCFBundleExecutable:CustomNameCFBundleIdentifier: (Optional but recommended)com.yourcompany.CustomName
Step 2: Configure CEF (Source Code)
You must explicitly tell CEF where to find this newly renamed sub-process, or it will continue looking for the default AppName Helper name.
You do this by setting the browser_subprocess_path in the CefSettings structure. This should be done in your application's initialization code (likely where you call CefInitialize). If you are using a file named cefhost.cpp, that is likely where this code resides.
Code Example:
// In your main process initialization (e.g., cefhost.cpp or main_mac.mm)
CefSettings settings;
// ... other settings ...
// Get the main bundle path
CefString main_bundle_path = CefGetMainBundlePath();
// Construct the full path to your renamed helper
// Path: Contents/Frameworks/ CustomName.app/Contents/MacOS/ CustomName
std::string helper_path = main_bundle_path.ToString() +
"/Contents/Frameworks/ CustomName.app/Contents/MacOS/ CustomName";
// Convert to CefString and assign to settings
CefString(&settings.browser_ subprocess_path) = helper_path;
// Initialize CEF
CefInitialize(main_args, settings, app, sandbox_info);
Important Note for Modern macOS (Catalina+)
Since macOS 10.15 (Catalina), strictly secure applications are required to use multiple helper apps with specific entitlements (e.g., one for GPU, one for Rendering, one for Plugins).
If you are shipping a modern, notarized macOS app, you generally need 4 distinct helper bundles:
CustomName.appCustomName (GPU).appCustomName (Renderer).appCustomName (Plugin).app
If you rename the main helper, you should ensure you rename/configure these variants as well if your build system generates them. However, setting browser_subprocess_path usually targets the "main" helper executable, which acts as the entry point for all sub-processes unless configured otherwise.
Summary Checklist
[ ] Rename
YourApp Helper.app->CustomName.app[ ] Rename binary inside
Contents/MacOS/[ ] Update
Info.plist(BundleName, Executable)[ ] Set
settings.browser_subprocess_in your C/C++ code.path
Change Application Display Name in Toolbar on macOS
This video demonstrates how to modify the Info.plist and CFBundleName for a macOS application, which is a necessary step when renaming your CEF helper app bundle.
No comments:
Post a Comment