I've noticed that NSTaks has this property as of macOS 14.4
@property (nullable, copy) NSData *launchRequirementData API_AVAILABLE(macos(14.4)) API_UNAVAILABLE(ios, watchos, tvos, visionos);
It has no documentation whatsoever. Even google search has no clue. Does this have anything to do with code signature requirements validation? Any explanations and examples would be appreciated!
General
RSS for tagDemystify code signing and its importance in app development. Get help troubleshooting code signing issues and ensure your app is properly signed for distribution.
Post
Replies
Boosts
Views
Activity
I am trying to code sign an application which relies on many python libraries to run. For background knowledge, the .app was created with a —onefile command on Visual Studio.
I code signed my application itself using
codesign --deep --force --verify --timestamp --sign "Developer ID Application: Issey Yohannes (GL5BCCW69X)" /Users/isseyyohannes/Desktop/Automated\ ALGORA.app
However, when I try to run the application the error shows in terminal as follows
[PYI-16345:ERROR] Failed to load Python shared library '/var/folders/g9/2zbc7y_97xxbq7bnc301nnyc0000gn/T/_MEI6keRcA/Python': dlopen: dlopen(/var/folders/g9/2zbc7y_97xxbq7bnc301nnyc0000gn/T/_MEI6keRcA/Python, 10): no suitable image found. Did find:
/var/folders/g9/2zbc7y_97xxbq7bnc301nnyc0000gn/T/_MEI6keRcA/Python: code signature in (/var/folders/g9/2zbc7y_97xxbq7bnc301nnyc0000gn/T/_MEI6keRcA/Python) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
/var/folders/g9/2zbc7y_97xxbq7bnc301nnyc0000gn/T/_MEI6keRcA/Python: stat() failed with errno=1
Through some external tools, I was able to narrow the issue as follows
Hardened Runtime Restriction: Your application is attempting to load a shared library (Python) at runtime, but the library is either: Not properly signed with the same Team ID as your app. Not marked as a valid platform binary. macOS requires all loaded libraries to comply with its code-signing and runtime security policies.
Any insight is much appreciated.
Short description of the issue/suggestion:
After upgrading to MacOS Sequoia and being required to code sign and notarize my app, cannot launch app even though code sign and notarization pass
Please tell us about your environment:
MacBookPro
Chip Apple M2 Max
32 GB
JavaPackager version: 1.7.6
OS version: macOS Sequoia 15.0.1
JDK version: jdk-1.8
Build tool: Maven
Steps to reproduce the issue:
-DMG Maven Build of Spring Boot /Java (version 8) application with "fvarrui" JavaPackager plugin using default universalJavaApplicationStub. Code signing and Notarization / Stapling PASS and App installs in Application folder, however cannot launch App. Although code sign and notarization pass, it is interesting that in the build output, prior to it submitting to Apple, there is an error stating that the App code sign could not be replaced.
What is the expected behavior?
-App launches when double clicking the application icon
What have you tried to resolve / workaround the issue?
-Install via package rather than DMG - same result
-Can launch App by opening up the app Content/MacOS folder and clicking directly on the universalJavaApplicationStub. Note requires that you allow it to run within the Security and Privacy settings.
codesign --verify --deep --verbose force1.app
force1.app: valid on disk
force1.app: satisfies its Designated Requirement
spctl -a -vvv force1.app
Info.plist.txt
pom.xml.txt
f
Build Output abridged.txt
o
SysConsoleOutput.txt
r
ce1.app: accepted
source=Notarized Developer ID
origin=Developer ID Application: Neal Hartmann (JPFYU53MK9)
Hi,
For the purposes of iteration speed in development builds, on an iPhone in development mode, I am attempting to use hot reloaded dylibs. The goal is that the app is rarely fully restarted and small code changes can be applied quickly, drastically reducing iteration speed.
For this purpose I have a socket server on my Mac that sends changed dylibs to my app on my iPhone. This works great on Mac, however on iOS i am running into codesigning problems.
I am using the following to codesign the dylib:
codesign -f -s *** --timestamp=none testlibrary-ios.dylib
I am placing the downloaded dylib in this folder:
const char* cachedirectoryPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)[0] UTF8String];
dlopen gives me the following error:
dlopen(/var/mobile/Containers/Data/Application/67A3D31B-6F72-4939-9E7F-665FC78CDC61/Library/Caches/testlibrary-ios.dylib, 0x000A): tried: '/usr/lib/system/introspection/testlibrary-ios.dylib' (no such file, not in dyld cache), '/var/mobile/Containers/Data/Application/67A3D31B-6F72-4939-9E7F-665FC78CDC61/Library/Caches/testlibrary-ios.dylib' (code signature invalid in <78A101AD-D756-3526-8754-8B7F4925DE90> '/private/var/mobile/Containers/Data/Application/67A3D31B-6F72-4939-9E7F-665FC78CDC61/Library/Caches/testlibrary-ios.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0000C2E0, codeBlobSize=0x00004990),
....
Is loading a dylib like this on iPhones in development mode possible?
Any idea what is going wrong with codesigning or installing the dylib?
(Obviously this code is never deployed in an app that goes on the AppStore)
I'm having a problem with codesign for output from Pyinstaller
The files are in ~/PycharmProjects/ALP_Document_Factory_II
That folder contains the icon file, the entitlement file, and also contains a "dist" folder where Pyinstaller places the app file (ALP_Document_Factory_II.app)
The generated app works and runs when I double click it.
When I run codesign:
codesign -s xxxxxxxx -f --entitlements entitlements.plist -o runtime dist/ALP_Document_Factory_II.app
("xxxxxxx" is where I place the hash of my credential)
I get the following error message: No such file or directory
Here is the Terminal copy... minus my Hash
dickl45@Dicks-iMac3 ALP_Document_Factory_II % codesign -s xxxxxxxxxx -f --entitlements entitlements.plist -o runtime dist/ALP_Document_Factory_II.app
dist/ALP_Document_Factory_II.app: No such file or directory
Earlier I was able to use codesign and notarytool, but I must be doing something wrong that I can't see.
Yours baffled
MacOs 15.2
We are trying to get much more serious about our ability to audit signed code and trace it back to a signing event. We have a signing service that includes a bit of client code that provides a CryptoTokenKit extension to expose the signing certificate to codesign and Xcode. The private keys are held by the signing service and access is strictly controlled.
The CTK extension is given a message/digest to sign, and from reading TN 3126, I believe this is representative of the code directory. For an audit trail, we can record some metadata about the signing request, such as Git repository, branch, commit SHA, etc., but the only value linked to the thing being signed is this blob.
Later, if we have an app and want to link it back to the signing event, I can't figure out how to find this blob. It's not the CDHash or any other value I see in the output of codesign -d -vvvvvv.
is there a way to recreate that blob given a signed artifact?
Hi at all, is there a way to count how many files have been marked with the codesign? Thanks in advance
Hi,
I know my swiftui, but I'm completely new to macOS development. Using Xcode 16.2 I wrote a backup app that fits my needs. I got it to use iCloud Documents in its own container. It runs beautifully on my developing Mac.
When I copy it over to my other Mac and try to open it, I just get a message that macOS can't open the app ("Das Programm kann nicht geöffnet werden")
In terminal I get this message: "embedded provisioning profile not valid: file:///Users/niko/FlexBackup.app/Contents/embedded.provisionprofile error: Error Domain=CPProfileManager Code=-212 "Provisioning profile does not allow this device."
I have "automatically manage signing" turned on and a Xcode Managed Profile.
How can I run my app on all of y Macs?
ad hoc和enterprise都不行
Team "tao yang (Personal Team)" is not enrolled in the Apple Developer Program.
Hi,
I am a newbie to this, I am trying to build my own ios phone app.
I am using my own phone as the developers phone so its set to debug.
Using Flutter I do flutter run. it get so far and always stops on :
Could not build the precompiled application for the device.
Error (Xcode): Unknown platform: "ios".
/Users/admin/group2/ios/Runner/Assets.xcassets
Error launching application on iPhone XS Max.
I have tried everything, so I thought someone on here might have the answer. I am happy to share any files or anything that you might need to recreate the issue.
如果你的 App 执行设备端收据验证,请确保你的 App 支持 SHA-256 算法。
我的APP接入了apple内购,我需要如何验证我的app支持 SHA-256 算法呢?
from; tkinter; import *
from; tkinter; import ttk
import random
import time
import sqlite3
#Connect; to; the; database (create, if it doesnot exist)
conn = sqlite3.connect("quiz_database.db")
c = conn.cursor()
Create the table if it doesnot exist
c.execute(""'CREATE TABLE IF NOT EXISTS questions
(id INTEGER PRIMARY KEY AUTOINCREMENT,
question TEXT,
answer1 TEXT,
answer2 TEXT,
correct_answer INTEGER)""')
conn.commit()
Sample data (replace with your own questions)
sample_questions = [
("Is the Earth flat?", "True", "False", 2),
("Do birds fly?", "True", "False", 1),
("Is water wet?", "True", "False", 1),
("Can humans breathe underwater?", "True", "False", 2),
]
c.executemany("INSERT OR IGNORE INTO questions (question, answer1, answer2, correct_answer) VALUES (?, ?, ?, ?)", sample_questions)
conn.commit()
class QuizApp:
def init(self, master):
self.master = master
master.title("True/False Quiz")
# Initialize variables
self.questions = []
self.current_question = 0
self.score = 0
self.start_time = 0
self.time_limit = 60 # Time limit in seconds
# Get questions from the database
self.load_questions()
# Create GUI elements
self.question_label = Label(master, text="", font=("Arial", 16))
self.question_label.pack(pady=20)
self.true_button = Button(master, text="True", command=lambda: self.check_answer(1), width=15)
self.true_button.pack(side=LEFT, padx=10)
self.false_button = Button(master, text="False", command=lambda: self.check_answer(2), width=15)
self.false_button.pack(side=RIGHT, padx=10)
self.feedback_label = Label(master, text="", font=("Arial", 12))
self.feedback_label.pack(pady=10)
self.timer_label = Label(master, text="Time Left: 60s", font=("Arial", 12))
self.timer_label.pack()
self.progress_bar = ttk.Progressbar(master, orient=HORIZONTAL, length=200, mode="determinate")
self.progress_bar.pack(pady=10)
self.start_quiz()
def load_questions(self):
c.execute("SELECT * FROM questions")
self.questions = c.fetchall()
random.shuffle(self.questions)
def start_quiz(self):
self.start_time = time.time()
self.display_question()
self.update_timer()
def display_question(self):
if self.current_question < len(self.questions):
question = self.questions[self.current_question]
self.question_label.config(text=question[1]) # Display the question
self.progress_bar["maximum"] = len(self.questions)
self.progress_bar["value"] = self.current_question + 1 # Update progress bar
def check_answer(self, selected_answer):
correct_answer = self.questions[self.current_question][4]
if selected_answer == correct_answer:
self.feedback_label.config(text="Correct!", fg="green")
self.score += 1
else:
self.feedback_label.config(text="Incorrect!", fg="red")
self.current_question += 1
if self.current_question < len(self.questions):
self.display_question()
else:
self.end_quiz()
def update_timer(self):
elapsed_time = time.time() - self.start_time
remaining_time = self.time_limit - elapsed_time
if remaining_time > 0:
self.timer_label.config(text=f"Time Left: {int(remaining_time)}s")
self.master.after(1000, self.update_timer)
else:
self.end_quiz()
def end_quiz(self):
self.true_button.config(state=DISABLED)
self.false_button.config(state=DISABLED)
self.feedback_label.config(text=f"Quiz Over! Your score: {self.score}/{len(self.questions)}")
Run the application
root = Tk()
app = QuizApp(root)
root.mainloop()
Close the database connection
conn.close()
I exported an app from an Xcode project using the "Archive" feature. After signing and notarizing it, the app runs normally on my local machine. However, after packaging it with create-dmg or ditto and distributing it to another Mac, I get an error saying the application cannot run. When I execute the command open ***.app in Terminal, it shows _LSOpenURLsWithCompletionHandler() failed for the application /Applications/Maxi PC Suite.app with error -10810. Does anyone know why this is happening?
codesign and notarization info:
codesign -vvv Maxi\ PC\ Suite.app
......
Maxi PC Suite.app: valid on disk
Maxi PC Suite.app: satisfies its Designated Requirement
syspolicy_check distribution Maxi\ PC\ Suite.app
App passed all pre-distribution checks and is ready for distribution.
I have an executable file named infogodesk, located in the directory /usr/local/SmpAgent/rustdesk/infogodesk. When I execute it using the terminal with ./infogodesk, the process gets terminated by the kernel. However, if I move the executable to another directory, it works fine.
This issue is very frustrating, and I hope to get some help. Below is the console log output:
默认 11:26:28.162205+0800 kernel ASP: Validation category (6) does not match top-level policy match (3) for process: /usr/local/SmpAgent/rustdesk/infogodesk
默认 11:26:28.162211+0800 kernel Validation category policy: Notifying syspolicyd about /usr/local/SmpAgent/rustdesk/infogodesk with PID 88264
默认 11:26:28.166695+0800 kernel CODE SIGNING: cs_invalid_page(0x104e04000): p=88264[infogodesk] final status 0x23000200, denying page sending SIGKILL
默认 11:26:28.166698+0800 kernel CODE SIGNING: process 88264[infogodesk]: rejecting invalid page at address 0x104e04000 from offset 0x0 in file "/usr/local/SmpAgent/rustdesk/infogodesk" (cs_mtime:1734509326.0 == mtime:1734509326.0) (depth:0)
默认 11:26:28.166738+0800 kernel infogodesk[88264] Corpse allowed 1 of 5
默认 11:26:28.255182+0800 ReportCrash ASI found [ReportCrash] (sensitive) 'Pid 88264 'infogodesk' CORPSE: Extracting
Completed 1, Recent: Pid 86766 'ReportCrash' CORPSE'
默认 11:26:28.261619+0800 ReportCrash ASI found [ReportCrash] (sensitive) 'Pid 88264 'infogodesk' CORPSE: Extracting
Completed 1, Recent: Pid 86767 'ReportCrash' CORPSE'
I want to code radeem for testflight
Chrome has started crashing almost immediately after startup. I've reported the issue to the Chrome team here: https://issues.chromium.org/issues/385433270
I'm hoping to debug the issue a bit more myself. This page from the Chrome team https://chromium.googlesource.com/chromium/src/+/master/docs/mac/debugging.md#chrome-builds suggests using the follow to strip off the protections:
codesign --force --sign - path/to/Google\ Chrome.app
However, applying that seems to have no effect:
% codesign --force --sign - /Applications/Google\ Chrome\ copy.app
/Applications/Google Chrome copy.app: replacing existing signature
/Applications/Google Chrome copy.app: resource fork, Finder information, or similar detritus not allowed
% lldb /Applications/Google\ Chrome\ copy.app
(lldb) target create "/Applications/Google Chrome copy.app"
Current executable set to '/Applications/Google Chrome copy.app' (arm64).
(lldb) run
error: process exited with status -1 (attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries, when the attach failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.))
I have tried other variations like the following based on Stack Overflow, this forum, etc., but with the same result. (I'm still a little vague on the meaning for some flags, sorry.) Though codesign says that it's "replacing existing signature", as far as I can tell, nothing is changing:
% cat <<EOF > debuggee-entitlement.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.get-task-allow</key>
<true/>
</dict>
</plist>
EOF
% codesign --verbose=4 -fs - --options library-validation --entitlements debuggee-entitlement.xml /Applications/Google\ Chrome\ copy.app
/Applications/Google Chrome copy.app: replacing existing signature
/Applications/Google Chrome copy.app: resource fork, Finder information, or similar detritus not allowed
file with invalid attached data: Disallowed xattr com.apple.FinderInfo found on /Applications/Google Chrome copy.app
lldb still fails the same way.
Here's what I see after the above:
% codesign -d -vvv /Applications/Google\ Chrome\ copy.app
Executable=/Applications/Google Chrome copy.app/Contents/MacOS/Google Chrome
Identifier=com.google.Chrome
Format=app bundle with Mach-O universal (x86_64 arm64)
CodeDirectory v=20500 size=1821 flags=0x12a00(kill,restrict,library-validation,runtime) hashes=46+7 location=embedded
Hash type=sha256 size=32
CandidateCDHash sha256=5d7beab2b03d9892426076b24acc19815d7a3ff8
CandidateCDHashFull sha256=5d7beab2b03d9892426076b24acc19815d7a3ff8c1446966e422c3c10672626b
Hash choices=sha256
CMSDigest=5d7beab2b03d9892426076b24acc19815d7a3ff8c1446966e422c3c10672626b
CMSDigestType=2
CDHash=5d7beab2b03d9892426076b24acc19815d7a3ff8
Signature size=8989
Authority=Developer ID Application: Google LLC (EQHXZ8M8AV)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=Dec 17, 2024 at 2:47:58 PM
Notarization Ticket=stapled
Info.plist entries=44
TeamIdentifier=EQHXZ8M8AV
Runtime Version=15.0.0
Sealed Resources version=2 rules=13 files=63
Internal requirements count=1 size=288
From what I can tell, my codesign runs have changed nothing... I see no diff as compared with what I see running codesign -d on a fresh copy.
Is it possible to strip off the protections on my local instance to allow debugging with lldb? If so, could someone share a command for accomplishing that?
Although I'm asking about this because of Chrome specifically, I'm hoping to learn more about codesigning in general and to be more empowered as a user to be able to debug when an app I depend on is crashing.
Thanks much! Happy Holidays!
Xcode 16.2 無法在IOS 18.2 Debug
Xcode 16.2
iOS 18.2
直接建立新專案
Xcode -> Create New Project -> Multiplatform -> Application -> App
選擇 實體手機 -> 執行
error: attach by pid '1050' failed -- attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries, when the attach failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.)
Logging Error: Failed to initialize logging system due to time out. Log messages may be missing. If this issue persists, try setting IDEPreferLogStreaming=YES in the active scheme actions environment variables.
note technically code-signing but related......
Why has there been no update to the documentation at:
https://developer.apple.com/documentation/appstorereceipts/validating_receipts_on_the_device
To demonstrate how to validate an SHA256 app store hash ???
The January deadline is looming and I can find no working example code which sucessfully validates an SHA256 hash
HELP !!!!
For some reason Xcode said my certificate was revoked. Developer support says it’s active. Could someone point me towards the steps to reactivate it?
We have an enterprise application which customers are using since long.
Suddenly some customers have reported they are unable to open app in iOS 18 OS. On lower versions like 17 it is working fine.
We have a deploy this enterprise application on our server from that link our customer can download and install the app in iPhone. Now they are blocked due to this error. After installing the app when they open app below error message is shown to them.
"AppName" is no longer available.