I updated the question, as I could narrow the problem down somewhat. Checking the crash log from console shows me that I am encountering a signature issue. I rebuilt the app without any CocoaPods and now have MSAL as a regular package dependency in my Xcode project.
When copying the project on a device and compiling it, the resulting app works great on that one device.
If I were to copy the .app file and open it on another mac however, the app does not launch. The error that I could find is from an Intel mac, as my Apple Silicon based mac does not produce any crash log:
"app_name":"ui_test","timestamp":"2023-10-03 16:46:47.00 +0200","app_version":"1.0","slice_uuid":"62be6a29-6e5b-37a4-b396-1dbdf81d3f43","build_version":"1","platform":0,"bundleID":"tardik.newtodomsal","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 13.6 (22G120)","roots_installed":0,"name":"ui_test","incident_id":"94B57AAB-CF8D-4A6A-8545-4D622547DA91"}
{
"uptime" : 7700,
"procRole" : "Default",
"version" : 2,
"userID" : 501,
"deployVersion" : 210,
"modelCode" : "MacPro7,1",
"coalitionID" : 1952,
"osVersion" : {
"train" : "macOS 13.6",
"build" : "22G120",
"releaseType" : "User"
},
"captureTime" : "2023-10-03 16:46:47.8577 +0200",
"incident" : "94B57AAB-CF8D-4A6A-8545-4D622547DA91",
"pid" : 3353,
"cpuType" : "X86-64",
"roots_installed" : 0,
"bug_type" : "309",
"procLaunch" : "2023-10-03 16:46:47.8008 +0200",
"procStartAbsTime" : 7793359661050,
"procExitAbsTime" : 7793416434750,
"procName" : "ui_test",
"procPath" : "/Volumes/VOLUME/ui_test.app/Contents/MacOS/ui_test",
"bundleInfo" : {"CFBundleShortVersionString":"1.0","CFBundleVersion":"1","CFBundleIdentifier":"tardik.newtodomsal"},
"storeInfo" : {"deviceIdentifierForVendor":"BF901324-EBC4-57EB-80A2-EA437BC60DE6","thirdParty":true},
"parentProc" : "launchd",
"parentPid" : 1,
"coalitionName" : "tardik.newtodomsal",
"crashReporterKey" : "FE05737C-5218-4DB2-B9C6-BE508F19E65F",
"codeSigningID" : "",
"codeSigningTeamID" : "",
"codeSigningFlags" : 16777216,
"codeSigningValidationCategory" : 0,
"codeSigningTrustLevel" : 0,
"wakeTime" : 6126,
"sleepWakeUUID" : "AF336868-DAC2-4830-A714-F1D0473DEE13",
"sip" : "enabled",
"exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGKILL (Code Signature Invalid)"},
"termination" : {"flags":66,"code":1,"namespace":"CODESIGNING","indicator":"Taskgated Invalid Signature"},
"extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":439,"task_for_pid":9},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
"faultingThread" : 0,
"threads" : [{"triggered":true,"id":104306,"threadState":{"r13":{"value":0},"rax":{"value":0},"rflags":{"value":512},"cpu":{"value":0},"r14":{"value":0},"rsi":{"value":0},"r8":{"value":0},"cr2":{"value":0},"rdx":{"value":0},"r10":{"value":0},"r9":{"value":0},"r15":{"value":0},"rbx":{"value":0},"trap":{"value":0},"err":{"value":0},"r11":{"value":0},"rip":{"value":4382367856,"matchesCrashFrame":1},"rbp":{"value":0},"rsp":{"value":140702045277168},"r12":{"value":0},"rcx":{"value":0},"flavor":"x86_THREAD_STATE","rdi":{"value":0}},"frames":[{"imageOffset":20592,"symbol":"_dyld_start","symbolLocation":0,"imageIndex":0},{"imageOffset":1,"imageIndex":2}]}],
"usedImages" : [
{
"size" : 638976,
"arch" : "x86_64",
"source" : "P",
"base" : 4382347264,
"uuid" : "3df96f32-b9c9-3566-a6b7-4daebc6d6563"
},
{
"source" : "P",
"arch" : "x86_64",
"base" : 4303515648,
"size" : 180224,
"uuid" : "62be6a29-6e5b-37a4-b396-1dbdf81d3f43",
"name" : ""
},
{
"size" : 0,
"source" : "A",
"base" : 0,
"uuid" : "00000000-0000-0000-0000-000000000000"
}
],
"vmSummary" : "ReadOnly portion of Libraries: Total=1180K resident=0K(0%) swapped_out_or_unallocated=1180K(100%)nWritable regions: Total=8192K written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=8192K(100%)nn VIRTUAL REGION nREGION TYPE SIZE COUNT (non-coalesced) n=========== ======= ======= nSTACK GUARD 56.0M 1 nStack 8192K 1 nVM_ALLOCATE 4K 1 n__DATA 48K 2 n__DATA_CONST 48K 2 n__DATA_DIRTY 16K 1 n__LINKEDIT 384K 3 n__TEXT 800K 2 nshared memory 4K 1 n=========== ======= ======= nTOTAL 65.3M 14 n",
"legacyInfo" : {
"threadTriggered" : {
}
},
"logWritingSignature" : "c8aecb4bac96e31f0d308bbfed9c73b1b8f822c9",
"trialInfo" : {
"rollouts" : [
{
"rolloutId" : "60186475825c62000ccf5450",
"factorPackIds" : {
},
"deploymentId" : 240000062
},
{
"rolloutId" : "6391cacc75b0720ff1f8c695",
"factorPackIds" : {
"COREOS_ICD" : "63957f508061fa721c8edc4a"
},
"deploymentId" : 240000007
}
],
"experiments" : [
{
"treatmentId" : "6dd670af-0633-45e4-ae5f-122ae4df02be",
"experimentId" : "64406ba83deb637ac8a04419",
"deploymentId" : 900000017
}
]
},
"reportNotes" : [
"dyld_process_snapshot_get_shared_cache failed"
]
}
2
Answers
I have finally found the answer, and it is none of the above. The App did not launch on other macs, because MSAL was used for authentication and it requires Keychain access to work. Keychain access is only available with a provisioning profile, and as I do not have a developer account with Apple, I can only sign the app to run on the device that is compiling the app, as far as I can tell.
Thus, I cannot do anything about it at this point if I understand correctly. Here a link for reference: https://learn.microsoft.com/en-us/azure/active-directory/develop/howto-v2-keychain-objc?tabs=swift
Even if I disable Keychain sharing, I still have to add that as an entitlement, thus requiring me to set provisioned devices. Kinda saddening, if I am incorrect on all of that, I would very much like to be in the wrong here, so please tell me if I am.
If you want to run a Mac app you built in Xcode on another Mac, archive and export the project.
See the following article for more details:
Running a Mac App Outside of Xcode