简体   繁体   English

用于Shell脚本的Mac OS X应用程序捆绑包不起作用

[英]Mac OS X app bundle for shell script doesn't works

I just did a app bundle like it's shown on this blog , but the app is not working. 我刚刚做了一个应用程序捆绑包,如本博客中所示,但该应用程序无法正常工作。 It looks like it will open (the OS X effect of the app opening) but then nothing happens, no window, no process, nothing. 看起来它将打开(应用程序打开的OS X效果),但是什么也没有发生,没有窗口,没有进程,什么也没有。 Running the script as ./app.sh on app directory works perfectly and opens app window. 在应用程序目录上以./app.sh运行脚本可以./app.sh工作并打开应用程序窗口。 The steps i'm doing are: 我正在做的步骤是:

  1. Copy appify script to my app directory. 将appify脚本复制到我的app目录中。
  2. Run appify. 运行appify。 Generates My App.app with shell script inside of Contents/MacOS/ and Info.plist file on Contents/ . Contents/MacOS/Contents/ Info.plist文件中使用外壳脚本生成My App.app
  3. As my app needs other files, i copy my data/ directory onto app bundle directory Contents/MacOS/data/ . 由于我的应用程序需要其他文件,因此我将data/目录复制到应用程序捆绑包目录Contents/MacOS/data/

I tried using appify script shown in the blog post and also the updated one . 我尝试使用博客文章中显示的appify脚本以及更新的脚本。 I also tried chmod +x on both, the .app bundle and the .sh inside of My App.app/Contents/MacOS/ . 我还在My App.app/Contents/MacOS/包和My App.app/Contents/MacOS/的.sh上都尝试了chmod +x

I'm lost on how to make the bundle run my app. 我不知道如何使捆绑软件运行我的应用程序。 Any clues on this? 有什么线索吗?

You don't need appify to create a script that can be executed with a mouse click (like an app), just follow this simple procedure: 您无需appify即可创建可通过鼠标单击执行的脚本(例如app),只需遵循以下简单过程即可:

  1. Create your script file (ex. myscript) 创建您的脚本文件(例如myscript)
  2. Give it execution permissions (chmod 755 ./myscript) 授予它执行权限(chmod 755 ./myscript)
  3. Contextual menu on the script file -> Get Info -> Open with: -> (Associate: Application->Utilities->Terminal app) 脚本文件上的上下文菜单->获取信息->打开方式:->(关联:应用程序->实用程序->终端应用程序)
  4. Contextual menu on the script file -> Get Info -> (Put the icon you want by drag/drop your icon file on the high left corner little icon) 脚本文件上的上下文菜单->获取信息->(将所需的图标拖放到左上角的小图标上)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM