关于xcode5打包不能自动更新资源解决办法

1、选择工程

2、选择Build Phases

3、添加 Run Script 项

4、写入以下shell脚本

_TARGET_BUILD_CONTENTS_PATH=$TARGET_BUILD_DIR/$CONTENTS_FOLDER_PATH

echo _TARGET_BUILD_CONTENTS_PATH: $_TARGET_BUILD_CONTENTS_PATH

echo PWD: $PWD


echo Cleaning $_TARGET_BUILD_CONTENTS_PATH/


rm -fr $_TARGET_BUILD_CONTENTS_PATH/res/*
                                        
rm -fr $_TARGET_BUILD_CONTENTS_PATH/scripts/*
mkdir -p $_TARGET_BUILD_CONTENTS_PATH/res/
mkdir -p $_TARGET_BUILD_CONTENTS_PATH/scripts/
cp -RLp $PWD/../res/* $_TARGET_BUILD_CONTENTS_PATH/res/
cp -RLp $PWD/../scripts/* $_TARGET_BUILD_CONTENTS_PATH/scripts/

 5、将 Run Script 上移动到 Compile Sources 前面,编译OK

你可能感兴趣的:(xcode)