A simple shell script integrated to Xcode to generate and copy architecture adaptive dylib in

if [ "$CONFIGURATION" == "Debug" ]; then

   LIBFFMPEG_DIR="$PROJECT_DIR/../../ffmpeg/ios/universal/debug"

else

   LIBFFMPEG_DIR="$PROJECT_DIR/../../ffmpeg/ios/universal/release"

fi

for a in $ARCHS; do

    EXTRACT_ARCHS="$EXTRACT_ARCHS -extract $a"

done

lipo "$LIBFFMPEG_DIR/lib/libffmpeg.dylib" $EXTRACT_ARCHS -output "$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/libffmpeg.dylib"

if [ "$CODE_SIGNING_REQUIRED" == "YES" ]; then

   codesign -s "$EXPANDED_CODE_SIGN_IDENTITY" "$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/libffmpeg.dylib"

fi

install_name_tool -change "libffmpeg.dylib" "@executable_path/libffmpeg.dylib" "$BUILT_PRODUCTS_DIR/$EXECUTABLE_PATH"