Frontesque / scrcpy-plus

A simple GUI for SCRCPY and other ADB functions
MIT License
520 stars 34 forks source link

Error detecting SCRCPY on MacOS #2

Closed zenminimalist closed 2 years ago

zenminimalist commented 2 years ago

Thanks for proving the instructions on building this great app for Mac.

I changed the .js file to linux, installed the necessary components, but get stuck on the "Electron-nuxt: Starting ..." Everything below the Nuxt [10:08:21 PM]is in red with no result in the build folder. Am sure I'm missing something...

% yarn build
yarn run v1.22.19
$ node .electron-nuxt/build.js

  Main   [10:08:20 PM]
│  Hash: 9da71251201a8cdcc9b9
│  Version: webpack 4.46.0
│  Time: 76ms
│  Built at: 07/03/2022 10:08:20 PM
│     Asset      Size  Chunks             Chunk Names
│  index.js  2.81 KiB       0  [emitted]  main
│  Entrypoint main = index.js
│  [0] external "electron" 42 bytes {0} [built]
│  [1] external "path" 42 bytes {0} [built]
│  [2] external "url" 42 bytes {0} [built]
│  [3] external "events" 42 bytes {0} [built]
│  [4] ./src/main/boot/index.prod.js 954 bytes {0} [built]
│  [5] ./src/main/index.js 348 bytes {0} [built]
│  [6] ./src/main/mainWindow.js + 1 modules 3.09 KiB {0} [built]
│      | ./src/main/mainWindow.js 444 bytes [built]
│      | ./src/main/BrowserWinHandler.js 2.65 KiB [built]

  Nuxt   [10:08:21 PM]
│  /Users/XXXX/Downloads/scrcpy-plus-main/src/renderer/nuxt.config.js:12
│      os: �linux�,
│          
│  
│  SyntaxError: Invalid or unexpected token
│      at Object.compileFunction (node:vm:353:18)
│      at wrapSafe (node:internal/modules/cjs/loader:1040:15)
│      at Module._compile (node:internal/modules/cjs/loader:1076:27)
│      at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
│      at Module.load (node:internal/modules/cjs/loader:988:32)
│      at Module._load (node:internal/modules/cjs/loader:834:12)
│      at Module.require (node:internal/modules/cjs/loader:1012:19)
│      at require (node:internal/modules/cjs/helpers:102:18)
│      at Object.<anonymous> (/Users/XXXX/Downloads/scrcpy-plus-main/.electron-nuxt/renderer/nuxt.config.js:11:24)
│      at Module._compile (node:internal/modules/cjs/loader:1112:14)
│      at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
│      at Module.load (node:internal/modules/cjs/loader:988:32)
│      at Module._load (node:internal/modules/cjs/loader:834:12)
│      at Module.require (node:internal/modules/cjs/loader:1012:19)
│      at require (node:internal/modules/cjs/helpers:102:18)
│      at Object.<anonymous> (/Users/XXXXX/Downloads/scrcpy-plus-main/.electron-nuxt/renderer/nuxt-process.js:3:20)
│  
│  Node.js v18.4.0
│  
⠹Electron-nuxt: Starting ...
zenminimalist commented 2 years ago

Ok, I found out what the issue was. Apparently my text editor of choice changed the quote " so something slightly different. That compiled the app.

However, now I've an error that I cannot solve: CleanShot 2022-07-03 at 22 26 15

If I use the CLI of scrcpy it works just fine. And if I enter the command scrcpy --version

% scrcpy --version 
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>

Dependencies (compiled / linked):
 - SDL: 2.0.22 / 2.0.22
 - libavcodec: 59.18.100 / 59.18.100
 - libavformat: 59.16.100 / 59.16.100
 - libavutil: 57.17.100 / 57.17.100
 - libusb: - / 1.0.26
Frontesque commented 2 years ago

I'll look into this. I think its also an issue on the latest version for linux. I'll update you here when i have a fix

Frontesque commented 2 years ago

I am unable to reproduce on my Linux machine (Fedora 35). However, it looks like you're using Node 18.4.0. SCRCPY+ only supports Node 16 right now. Try downgrading your NodeJS version?

zenminimalist commented 2 years ago

Ok I'll try that and let you know. What's the brew command to downgrade my node version. Never done that.

Frontesque commented 2 years ago

Ok I'll try that and let you know. What's the brew command to downgrade my node version. Never done that.

sorry I tried answering from my phone and accidentally edited your comment.

you can reinstall node as follows brew remove node brew install node@16.15.1

zenminimalist commented 2 years ago

I was able to uninstall node 18 and install 16. However, when I check node -v. I get v17.5.0. So I had to install the node version manager and now I was able to switch to v16.

However, I'm afraid I still get the same problem, more or less. Sorry, to be such a nuisance. CleanShot 2022-07-04 at 23 50 46

If you want I can send of the .app file. Not sure if that would help.

Anyway, here's the terminal output:

XXXXX@MacBook-Air-M1 scrcpy-plus-main % yarn build                                 
yarn run v1.22.19
$ node .electron-nuxt/build.js

  Main   [11:46:57 PM]
│  Hash: 9da71251201a8cdcc9b9
│  Version: webpack 4.46.0
│  Time: 136ms
│  Built at: 07/04/2022 11:46:57 PM
│     Asset      Size  Chunks             Chunk Names
│  index.js  2.81 KiB       0  [emitted]  main
│  Entrypoint main = index.js
│  [0] external "electron" 42 bytes {0} [built]
│  [1] external "path" 42 bytes {0} [built]
│  [2] external "url" 42 bytes {0} [built]
│  [3] external "events" 42 bytes {0} [built]
│  [4] ./src/main/boot/index.prod.js 954 bytes {0} [built]
│  [5] ./src/main/index.js 348 bytes {0} [built]
│  [6] ./src/main/mainWindow.js + 1 modules 3.09 KiB {0} [built]
│      | ./src/main/mainWindow.js 444 bytes [built]
│      | ./src/main/BrowserWinHandler.js 2.65 KiB [built]

  Nuxt   [11:46:58 PM]
│  ℹ Production build
│  
│  ℹ Bundling only for client side
│  
│  ℹ Target: static
│  
│  ℹ Using components loader to optimize imports
│  
│  ℹ Discovered Components: src/renderer/.nuxt/components/readme.md
│  
│  ✔ Builder initialized
│  
│  ✔ Nuxt files generated
│  
│  ℹ Compiling Client
│  
│  ✔ Client: Compiled successfully in 8.27s
│  
│  
│  Hash: adffda529fde249acfed
│  Version: webpack 4.46.0
│  Time: 8270ms
│  Built at: 07/04/2022 11:47:06 PM
│                           Asset       Size  Chunks                                Chunk Names
│  ../server/client.manifest.json   17.1 KiB          [emitted]                     
│                      052a398.js    5.1 KiB      21  [emitted] [immutable]         pages/wirelessSetup
│                      0a019e2.js   47.4 KiB       4  [emitted] [immutable]         vendors/pages/tools/files/pages/wirelessSetup
│                      173edd3.js   16.1 KiB       9  [emitted] [immutable]         components/device
│                      197f699.js   2.81 KiB      20  [emitted] [immutable]         pages/tools/resources
│                      1e74f66.js    189 KiB       6  [emitted] [immutable]         commons/app
│                      1f58bcb.js   57.8 KiB      17  [emitted] [immutable]         pages/tools/apps
│                      3a142f3.js   34.8 KiB       0  [emitted] [immutable]         vendors/components/adb/components/back/components/device/components/scrcpy/components/scrcpy-plus-in/7656fd7d
│                      3ac29e0.js   35.2 KiB       2  [emitted] [immutable]         vendors/components/device/components/scrcpy/pages/index/pages/tools/apps/pages/tools/files
│                      3d6d815.js   5.77 KiB       8  [emitted] [immutable]         components/back
│                      3e1cfbf.js    103 KiB  16, 10  [emitted] [immutable]         pages/index
│                      437395a.js   13.4 KiB      19  [emitted] [immutable]         pages/tools/files
│                      6b0f5d5.js  292 bytes      18  [emitted] [immutable]         pages/tools/dump
│                      6f03d76.js   30.5 KiB       1  [emitted] [immutable]         vendors/components/scrcpy/components/scrcpy-plus-info/components/update-notice/pages/changelog/pages/466dd3a3
│                      7d924c8.js   31.9 KiB      12  [emitted] [immutable]         components/tools
│                      9aa6f76.js   31.1 KiB      24  [emitted] [immutable]         vendors/pages/wirelessSetup
│                        LICENSES  407 bytes          [emitted]                     
│                      a57b893.js    8.5 KiB      15  [emitted] [immutable]         pages/changelog
│                      b321dc9.js   50.3 KiB       5  [emitted] [immutable]         app
│                      b47d410.js   23.4 KiB       3  [emitted] [immutable]         vendors/components/scrcpy/components/scrcpy-plus-info/components/update-notice/pages/index/pages/tools/apps
│                      be261a3.js   11.2 KiB       7  [emitted] [immutable]         components/adb
│                      bfc96e9.js   7.42 KiB      14  [emitted] [immutable]         components/wheel
│                      c3bc5a7.js   79.3 KiB      10  [emitted] [immutable]         components/scrcpy
│                      d2b86c5.js    322 KiB      23  [emitted] [immutable]  [big]  vendors/app
│                      d36a036.js   10.6 KiB      11  [emitted] [immutable]         components/scrcpy-plus-info
│                      fa25a3a.js   2.54 KiB      22  [emitted] [immutable]         runtime
│                      fa59b7a.js   18.9 KiB      13  [emitted] [immutable]         components/update-notice
│            img/icon.ecd8200.png   26.2 KiB          [emitted] [immutable]         
│   + 1 hidden asset
│  Entrypoint app = fa25a3a.js 1e74f66.js d2b86c5.js b321dc9.js
│  
│  WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
│  This can impact web performance.
│  Assets: 
│    d2b86c5.js (322 KiB)
│  
│  ℹ Generating output directory: renderer/
│  
│  ℹ Generating pages
│  
│  ✔ Generated route "/"
│  
│  ✔ Client-side fallback created: 200.html
│  
⠼ Electron-nuxt: Starting ...
✔ Electron-nuxt: All steps completed.

  Electron-builder   [11:47:06 PM]
│    • electron-builder  version=22.14.13 os=21.5.0
│  
│    • loaded configuration  file=/Users/XXXXX/Downloads/scrcpy-plus-main/builder.config.js
│  
│    • packaging       platform=darwin arch=arm64 electron=19.0.7 appOutDir=build/mac-arm64
│  
│    • downloading     url=https://github.com/electron/electron/releases/download/v19.0.7/electron-v19.0.7-darwin-arm64.zip size=79 MB parts=8
│  
│    • downloaded      url=https://github.com/electron/electron/releases/download/v19.0.7/electron-v19.0.7-darwin-arm64.zip duration=7.48s
│  
│    • skipped macOS application code signing  reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, it could cause some undefined behaviour, e.g. macOS localized description not visible, see https://electron.build/code-signing allIdentities=     0 identities found
│                                                  Valid identities only
│       0 valid identities found
│  
│    • building        target=DMG arch=arm64 file=build/scrcpy-plus-1.4.1-mac-arm64.dmg
│  
│    • Detected arm64 process, HFS+ is unavailable. Creating dmg with APFS - supports Mac OSX 10.12+
│  
│    ⨯ Exit code: ENOENT. spawn /usr/bin/python ENOENT  failedTask=build stackTrace=Error: Exit code: ENOENT. spawn /usr/bin/python ENOENT
│      at /Users/XXXXX/Downloads/scrcpy-plus-main/node_modules/builder-util/src/util.ts:133:18
│      at exithandler (node:child_process:406:5)
│      at ChildProcess.errorhandler (node:child_process:418:5)
│      at ChildProcess.emit (node:events:527:28)
│      at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
│      at onErrorNT (node:internal/child_process:478:16)
│      at processTicksAndRejections (node:internal/process/task_queues:83:21)
│  
│  Error: Command failed with exit code 1: electron-builder --config builder.config.js
│    • electron-builder  version=22.14.13 os=21.5.0
│    • loaded configuration  file=/Users/XXXXX/Downloads/scrcpy-plus-main/builder.config.js
│    • packaging       platform=darwin arch=arm64 electron=19.0.7 appOutDir=build/mac-arm64
│    • downloading     url=https://github.com/electron/electron/releases/download/v19.0.7/electron-v19.0.7-darwin-arm64.zip size=79 MB parts=8
│    • downloaded      url=https://github.com/electron/electron/releases/download/v19.0.7/electron-v19.0.7-darwin-arm64.zip duration=7.48s
│    • skipped macOS application code signing  reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, it could cause some undefined behaviour, e.g. macOS localized description not visible, see https://electron.build/code-signing allIdentities=     0 identities found
│                                                  Valid identities only
│       0 valid identities found
│    • building        target=DMG arch=arm64 file=build/scrcpy-plus-1.4.1-mac-arm64.dmg
│    • Detected arm64 process, HFS+ is unavailable. Creating dmg with APFS - supports Mac OSX 10.12+
│    ⨯ Exit code: ENOENT. spawn /usr/bin/python ENOENT  failedTask=build stackTrace=Error: Exit code: ENOENT. spawn /usr/bin/python ENOENT
│      at /Users/XXXXX/Downloads/scrcpy-plus-main/node_modules/builder-util/src/util.ts:133:18
│      at exithandler (node:child_process:406:5)
│      at ChildProcess.errorhandler (node:child_process:418:5)
│      at ChildProcess.emit (node:events:527:28)
│      at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
│      at onErrorNT (node:internal/child_process:478:16)
│      at processTicksAndRejections (node:internal/process/task_queues:83:21)
│      at makeError (/Users/XXXXX/Downloads/scrcpy-plus-main/node_modules/execa/lib/error.js:59:11)
│      at handlePromise (/Users/XXXXX/Downloads/scrcpy-plus-main/node_modules/execa/index.js:114:26)
│      at processTicksAndRejections (node:internal/process/task_queues:96:5) {
│    shortMessage: 'Command failed with exit code 1: electron-builder --config builder.config.js',
│    command: 'electron-builder --config builder.config.js',
│    exitCode: 1,
│    signal: undefined,
│    signalDescription: undefined,
│    stdout: '  • electron-builder  version=22.14.13 os=21.5.0\n' +
│      '  • loaded configuration  file=/Users/XXXXX/Downloads/scrcpy-plus-main/builder.config.js\n' +
│      '  • packaging       platform=darwin arch=arm64 electron=19.0.7 appOutDir=build/mac-arm64\n' +
│      '  • downloading     url=https://github.com/electron/electron/releases/download/v19.0.7/electron-v19.0.7-darwin-arm64.zip size=79 MB parts=8\n' +
│      '  • downloaded      url=https://github.com/electron/electron/releases/download/v19.0.7/electron-v19.0.7-darwin-arm64.zip duration=7.48s\n' +
│      '  • skipped macOS application code signing  reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, it could cause some undefined behaviour, e.g. macOS localized description not visible, see https://electron.build/code-signing allIdentities=     0 identities found\n' +
│      '                                                Valid identities only\n' +
│      '     0 valid identities found\n' +
│      '  • building        target=DMG arch=arm64 file=build/scrcpy-plus-1.4.1-mac-arm64.dmg\n' +
│      '  • Detected arm64 process, HFS+ is unavailable. Creating dmg with APFS - supports Mac OSX 10.12+\n' +
│      '  ⨯ Exit code: ENOENT. spawn /usr/bin/python ENOENT  failedTask=build stackTrace=Error: Exit code: ENOENT. spawn /usr/bin/python ENOENT\n' +
│      '    at /Users/XXXXX/Downloads/scrcpy-plus-main/node_modules/builder-util/src/util.ts:133:18\n' +
│      '    at exithandler (node:child_process:406:5)\n' +
│      '    at ChildProcess.errorhandler (node:child_process:418:5)\n' +
│      '    at ChildProcess.emit (node:events:527:28)\n' +
│      '    at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)\n' +
│      '    at onErrorNT (node:internal/child_process:478:16)\n' +
│      '    at processTicksAndRejections (node:internal/process/task_queues:83:21)',
│    stderr: '',
│    failed: true,
│    timedOut: false,
│    isCanceled: false,
│    killed: false
│  }
│  
⠸ Electron-nuxt: Building app for distribution
✖ Electron-nuxt: Error occurred when building application
PipelineError: Error occurred when building application
    at ElectronBuilder.<anonymous> (/Users/XXXXX/Downloads/scrcpy-plus-main/node_modules/@xpda-dev/electron-builder/lib/ElectronBuilder.js:29:23)
    at Generator.throw (<anonymous>)
    at rejected (/Users/XXXXX/Downloads/scrcpy-plus-main/node_modules/@xpda-dev/electron-builder/lib/ElectronBuilder.js:5:65)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
XXXXX@MacBook-Air-M1 scrcpy-plus-main %
Frontesque commented 2 years ago

instead of running yarn build can you try yarn dev and send me a screenshot of the console window that opens up inside scrcpy+ after loading?

zenminimalist commented 2 years ago

Sure thing. CleanShot 2022-07-05 at 09 49 13

Frontesque commented 2 years ago

Sure thing. CleanShot 2022-07-05 at 09 49 13

it appears that running it as dev caused it to detect scrcpy, as you can see by the version number at the top

zenminimalist commented 2 years ago

Yeah, but when I start the app normally it gives me the error from above. When I enter scrcpy --version it gives me:

Dependencies (compiled / linked):
 - SDL: 2.0.22 / 2.0.22
 - libavcodec: 59.18.100 / 59.18.100
 - libavformat: 59.16.100 / 59.16.100
 - libavutil: 57.17.100 / 57.17.100
 - libusb: - / 1.0.26

So that command does work in the terminal. (I have the CLI version of scrcpy installed and that works). I'm really stumped what it could be. Is there a logged version of your app I can run?

zenminimalist commented 2 years ago

I just tried the new build (the app notifies if there's a new update, so that seems to work just fine). However, I still have the same issue in v1.5. I pasted the terminal output.

Or is there a way I can double click the installed app and have it run in dev mode (without the right inspector screen popping up) all the time?

scrcpy-plus-1.5.0 % yarn build  
yarn run v1.22.19
$ node .electron-nuxt/build.js

  Main   [4:58:27 PM]
│  Hash: 3080f94ef577ef5c8524
│  Version: webpack 4.46.0
│  Time: 221ms
│  Built at: 07/08/2022 4:58:27 PM
│     Asset      Size  Chunks             Chunk Names
│  index.js  2.81 KiB       0  [emitted]  main
│  Entrypoint main = index.js
│  [0] external "electron" 42 bytes {0} [built]
│  [1] external "path" 42 bytes {0} [built]
│  [2] external "url" 42 bytes {0} [built]
│  [3] external "events" 42 bytes {0} [built]
│  [4] ./src/main/boot/index.prod.js 954 bytes {0} [built]
│  [5] ./src/main/index.js 348 bytes {0} [built]
│  [6] ./src/main/mainWindow.js + 1 modules 3.09 KiB {0} [built]
│      | ./src/main/mainWindow.js 444 bytes [built]
│      | ./src/main/BrowserWinHandler.js 2.65 KiB [built]

  Nuxt   [4:58:28 PM]
│  ℹ Production build
│  
│  ℹ Bundling only for client side
│  
│  ℹ Target: static
│  
│  ℹ Using components loader to optimize imports
│  
│  ℹ Discovered Components: src/renderer/.nuxt/components/readme.md
│  
│  ✔ Builder initialized
│  
│  ✔ Nuxt files generated
│  
│  ℹ Compiling Client
│  
│  ✔ Client: Compiled successfully in 17.63s
│  
│  
│  Hash: da03b2ea4fbfefbb30e1
│  Version: webpack 4.46.0
│  Time: 17627ms
│  Built at: 07/08/2022 4:58:46 PM
│                           Asset       Size  Chunks                                Chunk Names
│  ../server/client.manifest.json   17.8 KiB          [emitted]                     
│                      0654348.js   5.17 KiB      23  [emitted] [immutable]         pages/wirelessSetup
│                      07a7c0d.js    322 KiB      25  [emitted] [immutable]  [big]  vendors/app
│                      11b58f7.js   34.8 KiB       3  [emitted] [immutable]         vendors/components/device/pages/index/pages/tools/apps/pages/tools/files
│                      14f98fc.js   10.3 KiB      12  [emitted] [immutable]         components/scrcpy-plus-info
│                      3a3a386.js   2.86 KiB      22  [emitted] [immutable]         pages/tools/resources
│                      3d56541.js  292 bytes      20  [emitted] [immutable]         pages/tools/dump
│                      3ed2aaa.js   30.5 KiB       1  [emitted] [immutable]         vendors/components/scrcpy/components/scrcpy-plus-info/components/update-notice/pages/changelog/pages/2a9d84e9
│                      49b421e.js   34.8 KiB       0  [emitted] [immutable]         vendors/components/adb/components/back/components/device/components/scrcpy/components/scrcpy-plus-in/dedf776e
│                      532d9de.js   57.9 KiB   19, 4  [emitted] [immutable]         pages/tools/apps
│                      58839a2.js   21.4 KiB       4  [emitted] [immutable]         vendors/components/scrcpy/pages/settings
│                      742d849.js   50.5 KiB       6  [emitted] [immutable]         app
│                      7d074cf.js   10.2 KiB      18  [emitted] [immutable]         pages/settings
│                      8b8437c.js   5.81 KiB       9  [emitted] [immutable]         components/back
│                      937c62e.js    9.5 KiB      16  [emitted] [immutable]         pages/changelog
│                      93daa2b.js   16.5 KiB      10  [emitted] [immutable]         components/device
│                        LICENSES  407 bytes          [emitted]                     
│                      a013ab3.js   31.1 KiB      26  [emitted] [immutable]         vendors/pages/wirelessSetup
│                      a142874.js   2.57 KiB      24  [emitted] [immutable]         runtime
│                      a2698a4.js    104 KiB   17, 4  [emitted] [immutable]         pages/index
│                      a3b6cf4.js   72.7 KiB      11  [emitted] [immutable]         components/scrcpy
│                      b3303f7.js    189 KiB       7  [emitted] [immutable]         commons/app
│                      b5bf61c.js   7.42 KiB      15  [emitted] [immutable]         components/wheel
│                      c1e1404.js   18.5 KiB      14  [emitted] [immutable]         components/update-notice
│                      d1b514e.js   23.8 KiB       2  [emitted] [immutable]         vendors/components/scrcpy/components/scrcpy-plus-info/components/update-notice/pages/index/pages/tools/apps
│                      d41709b.js   11.2 KiB       8  [emitted] [immutable]         components/adb
│                      dbbc622.js   31.9 KiB      13  [emitted] [immutable]         components/tools
│                      e5782e0.js     14 KiB      21  [emitted] [immutable]         pages/tools/files
│                      ff66333.js   47.4 KiB       5  [emitted] [immutable]         vendors/pages/tools/files/pages/wirelessSetup
│            img/icon.ecd8200.png   26.2 KiB          [emitted] [immutable]         
│   + 1 hidden asset
│  Entrypoint app = a142874.js b3303f7.js 07a7c0d.js 742d849.js
│  
│  WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
│  This can impact web performance.
│  Assets: 
│    07a7c0d.js (322 KiB)
│  
│  ℹ Generating output directory: renderer/
│  
│  ℹ Generating pages
│  
│  ✔ Generated route "/"
│  
│  ✔ Client-side fallback created: 200.html
│  
⠏ Electron-nuxt: Starting ...
✔ Electron-nuxt: All steps completed.

  Electron-builder   [4:58:47 PM]
│    • electron-builder  version=22.14.13 os=21.5.0
│  
│    • loaded configuration  file=/Users/XXXX/Downloads/scrcpy-plus-1.5.0/builder.config.js
│  
│    • packaging       platform=darwin arch=arm64 electron=19.0.7 appOutDir=build/mac-arm64
│  
│    • skipped macOS application code signing  reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, it could cause some undefined behaviour, e.g. macOS localized description not visible, see https://electron.build/code-signing allIdentities=     0 identities found
│                                                  Valid identities only
│       0 valid identities found
│    • building        target=DMG arch=arm64 file=build/scrcpy-plus-1.4.2-mac-arm64.dmg
│  
│    • Detected arm64 process, HFS+ is unavailable. Creating dmg with APFS - supports Mac OSX 10.12+
│  
│    ⨯ Exit code: ENOENT. spawn /usr/bin/python ENOENT  failedTask=build stackTrace=Error: Exit code: ENOENT. spawn /usr/bin/python ENOENT
│      at /Users/XXXXX/Downloads/scrcpy-plus-1.5.0/node_modules/builder-util/src/util.ts:133:18
│      at exithandler (node:child_process:397:5)
│      at ChildProcess.errorhandler (node:child_process:409:5)
│      at ChildProcess.emit (node:events:537:28)
│      at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
│      at onErrorNT (node:internal/child_process:476:16)
│      at processTicksAndRejections (node:internal/process/task_queues:82:21)
│  
│  Error: Command failed with exit code 1: electron-builder --config builder.config.js
│    • electron-builder  version=22.14.13 os=21.5.0
│    • loaded configuration  file=/Users/XXXX/Downloads/scrcpy-plus-1.5.0/builder.config.js
│    • packaging       platform=darwin arch=arm64 electron=19.0.7 appOutDir=build/mac-arm64
│    • skipped macOS application code signing  reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, it could cause some undefined behaviour, e.g. macOS localized description not visible, see https://electron.build/code-signing allIdentities=     0 identities found
│                                                  Valid identities only
│       0 valid identities found
│    • building        target=DMG arch=arm64 file=build/scrcpy-plus-1.4.2-mac-arm64.dmg
│    • Detected arm64 process, HFS+ is unavailable. Creating dmg with APFS - supports Mac OSX 10.12+
│    ⨯ Exit code: ENOENT. spawn /usr/bin/python ENOENT  failedTask=build stackTrace=Error: Exit code: ENOENT. spawn /usr/bin/python ENOENT
│      at /Users/XXXXXX/Downloads/scrcpy-plus-1.5.0/node_modules/builder-util/src/util.ts:133:18
│      at exithandler (node:child_process:397:5)
│      at ChildProcess.errorhandler (node:child_process:409:5)
│      at ChildProcess.emit (node:events:537:28)
│      at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
│      at onErrorNT (node:internal/child_process:476:16)
│      at processTicksAndRejections (node:internal/process/task_queues:82:21)
│      at makeError (/Users/XXXXX/Downloads/scrcpy-plus-1.5.0/node_modules/execa/lib/error.js:59:11)
│      at handlePromise (/Users/XXXX/Downloads/scrcpy-plus-1.5.0/node_modules/execa/index.js:114:26)
│      at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
│    shortMessage: 'Command failed with exit code 1: electron-builder --config builder.config.js',
│    command: 'electron-builder --config builder.config.js',
│    exitCode: 1,
│    signal: undefined,
│    signalDescription: undefined,
│    stdout: '  • electron-builder  version=22.14.13 os=21.5.0\n' +
│      '  • loaded configuration  file=/Users/XXXXX/Downloads/scrcpy-plus-1.5.0/builder.config.js\n' +
│      '  • packaging       platform=darwin arch=arm64 electron=19.0.7 appOutDir=build/mac-arm64\n' +
│      '  • skipped macOS application code signing  reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, it could cause some undefined behaviour, e.g. macOS localized description not visible, see https://electron.build/code-signing allIdentities=     0 identities found\n' +
│      '                                                Valid identities only\n' +
│      '     0 valid identities found\n' +
│      '  • building        target=DMG arch=arm64 file=build/scrcpy-plus-1.4.2-mac-arm64.dmg\n' +
│      '  • Detected arm64 process, HFS+ is unavailable. Creating dmg with APFS - supports Mac OSX 10.12+\n' +
│      '  ⨯ Exit code: ENOENT. spawn /usr/bin/python ENOENT  failedTask=build stackTrace=Error: Exit code: ENOENT. spawn /usr/bin/python ENOENT\n' +
│      '    at /Users/XXXXX/Downloads/scrcpy-plus-1.5.0/node_modules/builder-util/src/util.ts:133:18\n' +
│      '    at exithandler (node:child_process:397:5)\n' +
│      '    at ChildProcess.errorhandler (node:child_process:409:5)\n' +
│      '    at ChildProcess.emit (node:events:537:28)\n' +
│      '    at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)\n' +
│      '    at onErrorNT (node:internal/child_process:476:16)\n' +
│      '    at processTicksAndRejections (node:internal/process/task_queues:82:21)',
│    stderr: '',
│    failed: true,
│    timedOut: false,
│    isCanceled: false,
│    killed: false
│  }
│  
⠏ Electron-nuxt: Building app for distribution
✖ Electron-nuxt: Error occurred when building application
PipelineError: Error occurred when building application
    at ElectronBuilder.<anonymous> (/Users/XXXX/Downloads/scrcpy-plus-1.5.0/node_modules/@xpda-dev/electron-builder/lib/ElectronBuilder.js:29:23)
    at Generator.throw (<anonymous>)
    at rejected (/Users/XXXX/Downloads/scrcpy-plus-1.5.0/node_modules/@xpda-dev/electron-builder/lib/ElectronBuilder.js:5:65)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
XXXX@MacBook-Air-M1 scrcpy-plus-1.5.0 % 
Frontesque commented 2 years ago

I don't know enough about MacOS to help figure out why you're having an issue with Electron Builder. You can read about turning off the dev tools here. that is done at src/main/mainWindow.js

Thelm76 commented 1 year ago

It sure looks like a PATH environment variable error.... when loading /bin/sh, it doesn't load the same things as the mac default zsh shell... When you do yarn dev, the envvars are transmitted to the app through the command line so it manages to find the executable. I'll try something and get back to you

Frontesque commented 1 year ago

It sure looks like a PATH environment variable error.... when loading /bin/sh, it doesn't load the same things as the mac default zsh shell... When you do yarn dev, the envvars are transmitted to the app through the command line so it manages to find the executable. I'll try something and get back to you

Is this still an issue? I thought that it had been resolved as user error but I could be wrong.

Thelm76 commented 1 year ago

Yes it is still an issue for me. I did a bit of investigation and it looks like the "this.$execute" doesn't launches the appropriate shell (/bin/sh instead of /bin/zsh on macOS) which seems to lead to incomplete PATH envvar... However I'm not familiar with Vue so it's a bit hard for me to help you...

EDIT: Just confirmed the behaviour as it works when running the command "open -a scrcpy+" from terminal... Also my device is not detected but not sure it is a related issue. But this should be re-opened (I run the 1.6.0 version)

Thelm76 commented 1 year ago

@Frontesque if you need me to run some tests on MacOs I'd be glad to help you

Frontesque commented 1 year ago

@Frontesque if you need me to run some tests on MacOs I'd be glad to help you

I've been looking into getting a Mac for debugging this project aswell as others. I need to understand this issue before I can fix it. I believe that the issue that you are facing is different from the original post.

The original issue was a compiling error with Electron. The new issue stated here is with the SCRCPY+ process not using zsh and instead using bash if I understand it correctly. I use Linux and haven't touched zsh too much so I'm unsure if the issue is also on Linux if the default shell is set to zsh though it works either way due to how Linux operates.

tl;dr: I need to figure out what is causing the issue. sending me the Console logs after running the program would be helpful.

Thelm76 commented 1 year ago

Ok, I found out what the issue was. Apparently my text editor of choice changed the quote " so something slightly different. That compiled the app.

However, now I've an error that I cannot solve: CleanShot 2022-07-03 at 22 26 15

If I use the CLI of scrcpy it works just fine. And if I enter the command scrcpy --version

% scrcpy --version 
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>

Dependencies (compiled / linked):
 - SDL: 2.0.22 / 2.0.22
 - libavcodec: 59.18.100 / 59.18.100
 - libavformat: 59.16.100 / 59.16.100
 - libavutil: 57.17.100 / 57.17.100
 - libusb: - / 1.0.26

Well I was referring to this message sorry for the misunderstanding. The issue is not related to zsh by itself but more with the fact that the environment variables on mac doesn't seem to be loaded properly with the /bin/sh executable (so not even bash related). Therefore the executable of scrcpy is not present in the $PATH variable, which leads to this issue.

Thelm76 commented 1 year ago

@Frontesque if you need me to run some tests on MacOs I'd be glad to help you

I've been looking into getting a Mac for debugging this project aswell as others. I need to understand this issue before I can fix it. I believe that the issue that you are facing is different from the original post.

The original issue was a compiling error with Electron. The new issue stated here is with the SCRCPY+ process not using zsh and instead using bash if I understand it correctly. I use Linux and haven't touched zsh too much so I'm unsure if the issue is also on Linux if the default shell is set to zsh though it works either way due to how Linux operates.

tl;dr: I need to figure out what is causing the issue. sending me the Console logs after running the program would be helpful.

You should put this solution into the wiki ^^' :

On MacOS, the environment variables are not properly set when launching an app from the dock. In order to get the proper environment variables, you need to sync them using this command in the terminal : launchctl setenv PATH $PATH and then restart the dock using killall Dock

handbye commented 1 year ago

@Frontesque如果您需要我在 MacO 上运行一些测试,我很乐意帮助您

我一直在考虑购买一台 Mac 来调试这个项目以及其他项目。我需要先了解这个问题,然后才能解决它。我相信您面临的问题与原始帖子不同。 最初的问题是 Electron 的编译错误。这里所说的新问题是 SCRCPY+ 进程不使用zsh,而是使用bash(如果我理解正确的话)。我使用 Linux,并且没有太多接触 zsh,所以我不确定如果默认 shell 设置为,问题是否也在 Linux 上,zsh但由于 Linux 的运行方式,它可以以任何方式工作。 tl;dr:我需要找出导致问题的原因。运行程序后向我发送控制台日志会很有帮助。

您应该将此解决方案放入 wiki ^^' :

在 MacOS 上,从 Dock 启动应用程序时未正确设置环境变量。 为了获得正确的环境变量,您需要在终端中使用以下命令同步它们: launchctl setenv PATH $PATH 然后使用 killall Dock

thanks a lot, that slove my problems