7 Replies
      Latest reply on Apr 13, 2019 4:55 AM by dwiedave
      dwiedave Level 1 Level 1 (0 points)

        Hello together;


        Im very new to Swift Programming and writing macOS Applications
        and can't figure out what the problem with my app is.

        On my MacBook (development mac) it is building flawlessly without any error

        and the archived and signed app is running as expected.
        I wanted to share the application with a friend of mine and hes not able to open the app.
        When he double clicks it theres a simple dialog with the alert: "The programm XX can not be opened"

        without any further error message.

        The macOS console didnt provide any useful info either:

        spawn_via_launchd() failed, errno=1

         

        I used the automatic signing in XCode with my Developer ID.

        If anyone has an idea of what might be wrong that would be great!

        Best regards

        David

        • Re: macOS app not running on different mac
          eskimo Apple Staff Apple Staff (11,355 points)

          In this context the error 1 is EPERM, meaning there’s definitely some sort of permissions issue.  This is likely to be something to do with Gatekeeper.

          The best way to test this is to zip up your app, upload it to a web server (if you don’t have a handy web server, email it to yourself), and then download it again.  The downloaded archive will be flagged as needing to be checked by Gatekeeper, as will the contents of the archive when you unpack it.  You can then run the app and it’s likely that it’ll have the same problem you’re friend is seeing.

          Once you’re able to reproduce the problem, post back and we can talk about what might be causing it.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

            • Re: macOS app not running on different mac
              dwiedave Level 1 Level 1 (0 points)

              Hey eskimo,
              Thank you for your reply!


              Thats a good tip!
              I uploaded a zipped version to my web server and downloaded it again
              I didnt receive any notification when unpacking and when running the app again (from my Downloads directory) I got a warning if i want to open the app downloaded from my server and after clicking open the app starts normally..

              So i wasnt able to reproduce the error.

              In terms of permissions I needed file-access to read and write a file to the filesystem so i added the following to my entitlements:
              com.apple.security.assets.pictures.read-write with a Boolean of YES

               

              Btw:
              is there a way to allow writing to the user folder without the user selecting a folder?
              (ive implemented a drag and drop view to resize images in their original folder)
              Right now the program only resizes and saves the new image when the original path was in the pictures folder
              But i didnt find any entitlement to allow writing for example to the documents folder

               

              EDIT:
              Ive managed to find someone else with a mac and the app ran as expected so I guess its maybe not the apps fault?
              But does anyone have an idea why it does not open on the other mac ?

              • Re: macOS app not running on different mac
                dwiedave Level 1 Level 1 (0 points)

                Hello eskimo;

                 

                I think I found the error why the program wasnt starting:

                I transferred the .app / .dmg to my friend via Telegram Messenger and it seems like they sanitized or manipulated

                something of the executable that it wasnt runnable anymore.

                I uploaded the dmg to my server and he downloaded it: now everything works as expected

                Thanks for your input!