wails: Mac Program cannot lauch

##################################################### V1 users: If you have a technical issue, please do not open a bug this way! Please use the wails issue command! If you do not do this then the issue may be closed automatically.

NOTE: If your bug is related to Windows, make sure you read the Windows Developer Guide #####################################################

Description using wails build to build a program on MacOS ,saying as myapp.app. when double click myapp.app, it can not be launched. but if i doubleclick myapp.app/Contents/MocOS/myapp, it can launch correctly.

To Reproduce Steps to reproduce the behaviour:

  1. Go to build/bin
  2. Double Click on ‘myapp.app’
  3. The program cannot be launched

Expected behaviour myapp.app should be launched without error

Screenshots n/a

System Details V2 users: Please add the output of wails doctor.

image

Additional context if i doubleclick myapp.app/Contents/MocOS/myapp, it can launch correctly.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (6 by maintainers)

Most upvoted comments

I think I solved it.

I did a local build on MacOS and ran the following to see if it was signed. It wasn’t. It was “ad hoc”:

codesign -dvvv QuiverPhotos.app

Executable=/Users/chrisesplin/dev/quiver-photos-v2/build/bin/QuiverPhotos.app/Contents/MacOS/QuiverPhotos
Identifier=a.out
Format=app bundle with Mach-O thin (arm64)
CodeDirectory v=20400 size=353406 flags=0x20002(adhoc,linker-signed) hashes=11041+0 location=embedded
Hash type=sha256 size=32
CandidateCDHash sha256=242107fffa6b02a3625d19107e96d0de81ba2d0c
CandidateCDHashFull sha256=242107fffa6b02a3625d19107e96d0de81ba2d0cbcdb30da55898cd66f9109a3
Hash choices=sha256
CMSDigest=242107fffa6b02a3625d19107e96d0de81ba2d0cbcdb30da55898cd66f9109a3
CMSDigestType=2
CDHash=242107fffa6b02a3625d19107e96d0de81ba2d0c
Signature=adhoc
Info.plist=not bound
TeamIdentifier=not set
Sealed Resources=none
Internal requirements=none

I already had my certificates configured on my machine, so I read out the developer ids:

bin git:(master) ✗ security find-identity -p codesigning -v
  1) BC6EEAC158FC4B9D9AEB734D65C115DB528E69F3 "Apple Development: Fáris Ismail (NBCZUK8367)"
  2) 35A795FE5BE240F5E3ABA5D3D51403D031328DA3 "Apple Development: Christopher Esplin (NLR9GCU5L5)"
  3) 4A1C379BF78BE47707CF84C2073274EEADF3CEB8 "Apple Distribution: Christopher Esplin (FZD76JR993)"
  4) 0359316A09368F4A5BBE08C9E662AD50D518591F "Developer ID Application: Christopher Esplin (FZD76JR993)"

Finally, I manually signed the executable and checked the signature again:

➜  bin git:(master) ✗ codesign -s "Developer ID Application: Christopher Esplin (FZD76JR993)" -f --timestamp -o runtime QuiverPhotos.app/Contents/MacOS/QuiverPhotos
QuiverPhotos.app/Contents/MacOS/QuiverPhotos: replacing existing signature
➜  bin git:(master) ✗ codesign -dvvv QuiverPhotos.app                                                                                                              
Executable=/Users/chrisesplin/dev/quiver-photos-v2/build/bin/QuiverPhotos.app/Contents/MacOS/QuiverPhotos
Identifier=com.chrisesplin.photos
Format=app bundle with Mach-O thin (arm64)
CodeDirectory v=20500 size=353538 flags=0x10000(runtime) hashes=11041+3 location=embedded
Hash type=sha256 size=32
CandidateCDHash sha256=7dcfb6deb617b18ed95c4b753f427b2ff74ddf3a
CandidateCDHashFull sha256=7dcfb6deb617b18ed95c4b753f427b2ff74ddf3ac32a6d1bc1010b8d62ec8d17
Hash choices=sha256
CMSDigest=7dcfb6deb617b18ed95c4b753f427b2ff74ddf3ac32a6d1bc1010b8d62ec8d17
CMSDigestType=2
CDHash=7dcfb6deb617b18ed95c4b753f427b2ff74ddf3a
Signature size=9057
Authority=Developer ID Application: Christopher Esplin (FZD76JR993)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=Mar 27, 2024 at 5:31:54 AM
Info.plist entries=11
TeamIdentifier=FZD76JR993
Runtime Version=14.4.0
Sealed Resources version=2 rules=13 files=1
Internal requirements count=1 size=184

The file opens up now when I double-click it!