我正在创建一个带有Settings.bundle文件的iPad应用程序.我正在编写构建脚本来显示应用程序版本号和xcode bot集成号(而不是bundle build number).我在网上搜索过,找不到任何解决方案.这是我得到的:
-- Add the app version number
cd $PROJECT_DIR
cd "$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app"
RELEASE_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" Info.plist)
/usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:1:DefaultValue $RELEASE_VERSION" Settings.bundle/Root.plist
-- Add the build version number
BUILD_NUMBER=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" Info.plist)
/usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:2:DefaultValue $BUILD_NUMBER" Settings.bundle/Root.plist
Run Code Online (Sandbox Code Playgroud)
在构建版本号中,我想用xcode bot集成号替换CFBundleVersion.
这是我的问题。我有一个在MacOS X上运行的Java应用程序。现在,我正在尝试在Mac App Store上使该应用程序可用。不幸的是,Apple始终拒绝我的应用程序,因为我没有使用本机FileDialog访问文件和目录。在某些情况下,用户必须选择其他目录中的文件。这是我尝试创建目录选择器的方法:
// Go in directory chooser mode
System.setProperty("apple.awt.fileDialogForDirectories", "true");
FileDialog dialog = new FileDialog(tamaggoApp.getFrame());
dialog.setDirectory(defaultDir);
dialog.setVisible(true);
// Set back the property to file chooser.
System.setProperty("apple.awt.fileDialogForDirectories", "false");
Run Code Online (Sandbox Code Playgroud)
不幸的是,它对我不起作用。似乎必须在main()方法中设置此属性,因此您无法在文件和目录选择之间切换。不能使用Swing JFileChooser,因为Apple会拒绝它(我尝试过)。