【问题标题】:Unable to build app for Mac OS X, getting error无法为 Mac OS X 构建应用程序,出现错误
【发布时间】:2012-08-23 05:50:47
【问题描述】:

我正在使用 ant 脚本构建 .dmg 文件,而它使用 applescript 将在下面显示。

下面是我遇到的错误。

installer.mac:
    [mkdir] Created dir: /Users/damuammu/Desktop/spark-Mac/target/installer
    [mkdir] Created dir:
/Users/damuammu/Desktop/spark-Mac/target/MixTalx_app/.background
     [copy] Copying 1 file to
/Users/damuammu/Desktop/spark-Mac/target/MixTalx_app/.background
  [symlink] ln -s /Applications
/Users/damuammu/Desktop/spark-Mac/target/MixTalx_app/Applications
     [echo] Create tmp.dmg
     [exec] created: /Users/damuammu/Desktop/spark-Mac/target/tmp.dmg
     [echo] Attach tmp.dmg
     [exec] /dev/disk2                  Apple_partition_scheme
     [exec] /dev/disk2s1                Apple_partition_map
     [exec] /dev/disk2s2                Apple_HFS
        /Users/damuammu/Desktop/spark-Mac/target/tmp
     [exec] cp:
/Users/damuammu/Desktop/spark-Mac/build/installer/mac/RightDSStore: No
such file or directory
     [exec] Result: 1
     [exec] mac/dmg_spark.scpt: execution error: Finder got an error:
Can’t set item "Spark.app" of disk "MixTalx_2.6.3" to {140, 250}.
(-10006)

BUILD FAILED
/Users/damuammu/Desktop/spark-Mac/build/build.xml:775: exec returned: 1

下面是小程序

on run {volumeName, artPath, theHeight, theWidth, x1, y1, x2, y2, iconSize}
    tell application "Finder"
        tell disk (volumeName as string)
            open

            delay 2

            set dsStore to "\"" & "/Volumes/" & volumeName & "/" & ".DS_STORE\""

            tell container window
                set current view to icon view
                set toolbar visible to false
                set statusbar visible to false
                set the bounds to {10, 10, 658, 482}
                set statusbar visible to false
            end tell

            set opts to the icon view options of container window
            set the arrangement of opts to not arranged
            set the icon size of opts to 128
            --iconSize
            set background picture of opts to file ".background:dmgBackground.png"

            -- Icon positions
            delay 2
            set position of item "Spark.app" to {140, 250}
            set position of item "Applications" to {395, 250}
            delay 2

            update without registering applications
        end tell


        delay 10
    end tell
end run

请任何人就这个问题提出建议。

【问题讨论】:

    标签: macos ant applescript dmg


    【解决方案1】:

    在运行 AppleScript 之前,您的 ant 脚本中会出现错误。错误在这里:

         [exec] cp:
    /Users/damuammu/Desktop/spark-Mac/build/installer/mac/RightDSStore: No
    such file or directory
    

    AppleScript 的作用是让您安装的 DMG 卷看起来很漂亮。由于并非所有内容都正确放入 DMG,Applescript 后来失败了:

         [exec] mac/dmg_spark.scpt: execution error: Finder got an error:
    Can’t set item "Spark.app" of disk "MixTalx_2.6.3" to {140, 250}.
    (-10006)
    

    但是,您需要做的是修复因第一个错误而失败的 ant 脚本。

    【讨论】:

      最近更新 更多