.App捆绑包中的外壳脚本出现
我使用名为 myApp.command 的shell脚本来打开一个应用程序,例如Microsoft PowerShell应用程序:
#!/bin/sh
exec /usr/local/microsoft/powershell/7/pwsh
脚本正常。但是,当我将相同的脚本放入MacOS捆绑包中(称为MyApp.App)时,它不起作用。我收到的错误消息是, myApp.app出人意料地退出。
错误报告显示,该错误发生在/applications/myapp.app/contents/macos/myapp.command中。
异常类型:exc_crash(sigabrt)
异常注意:exc_corpse_notify
程序特定信息:abort()称为
info of Info.plist.plist。
<?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>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleGetInfoString</key>
<string>1.0, Copyright © 2019 MyCompany, All Rights Reserved</string>
<key>CFBundleIdentifier</key>
<string>com.mycompany.MyApp</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>mycompany.myapp</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019 MyCompany, All Rights Reserved.</string>
<key>NSPrincipalClass</key>
<string>ShellScript</string>
<key>CFBundleExecutable</key>
<string>myapp.command</string>
<key>CFBundleIconFile</key>
<string>MyCompany</string>
<key>NSMainNibFile</key>
<string>main.nib</string>
</dict>
</plist>
应用
I use a shell script named myapp.command to open an app such as the Microsoft PowerShell app:
#!/bin/sh
exec /usr/local/microsoft/powershell/7/pwsh
The script works fine. However, when I put the same script inside a macOS bundle (called myapp.app), it does not work. The error message I get is, myapp.app quit unexpectedly.
Error report reveals that the error occurs in /Applications/myapp.app/Contents/MacOS/myapp.command.
Exception type: EXC_CRASH (SIGABRT)
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information: abort() called
The contents of Info.plist are as follows:
<?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>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleGetInfoString</key>
<string>1.0, Copyright © 2019 MyCompany, All Rights Reserved</string>
<key>CFBundleIdentifier</key>
<string>com.mycompany.MyApp</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>mycompany.myapp</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019 MyCompany, All Rights Reserved.</string>
<key>NSPrincipalClass</key>
<string>ShellScript</string>
<key>CFBundleExecutable</key>
<string>myapp.command</string>
<key>CFBundleIconFile</key>
<string>MyCompany</string>
<key>NSMainNibFile</key>
<string>main.nib</string>
</dict>
</plist>
How can I fix/troubleshoot this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
pwsh
崩溃,因为它未连接到任何工作的TTY,就是告诉终端应用程序启动它:
pwsh
crashes because it is not connected to any ttyA work-around is to tell the Terminal App to launch it: