Repository: MaaXYZ/MaaFramework (language: python)

Issue:
macos aarch64 下无法运行，找不到 libc++.dylib
![_ 5)R0RE$}6J9F81JSBDV O_tmb](https://github.com/MaaXYZ/MaaFramework/assets/18511905/0466362f-d2e0-41ae-9db4-daadb1c8ed54)



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 3f08cf845..a19b93907 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -201,7 +201,7 @@ jobs:
     strategy:
       matrix:
         include:
-          - os: macos-12
+          - os: macos-13
             arch: x86_64
           - os: macos-14
             arch: aarch64
@@ -215,7 +215,7 @@ jobs:
 
       - name: Install dep
         run: |
-          brew install cmake python ninja
+          brew install cmake ninja
         # ccache?
 
       - name: Install compiler
@@ -234,10 +234,8 @@ jobs:
         env:
           CC: "/usr/local/opt/llvm/bin/clang"
           CXX: "/usr/local/opt/llvm/bin/clang++"
-          LDFLAGS: "-L/usr/local/opt/llvm/lib/c++ -Wl,-rpath,/usr/local/opt/llvm/lib/c++"
         run: |
           cmake --preset 'NinjaMulti' \
-            -DCMAKE_OSX_ARCHITECTURES='${{ matrix.arch == 'x86_64' && 'x86_64' || 'arm64' }}' \
             -DMAADEPS_TRIPLET='maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-osx' \
             -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}'
 
@@ -248,7 +246,6 @@ jobs:
         env:
           CC: "/opt/homebrew/opt/llvm/bin/clang"
           CXX: "/opt/homebrew/opt/llvm/bin/clang++"
-          LDFLAGS: "-L/opt/homebrew/opt/llvm/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++"
         run: |
           cmake --preset 'NinjaMulti' \
             -DMAADEPS_TRIPLET='maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-osx' \
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 3c3bba394..667c48607 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -16,6 +16,12 @@
     "[python]": {
         "editor.defaultFormatter": "ms-python.black-formatter"
     },
+    "[yaml]": {
+        "editor.insertSpaces": true,
+        "editor.tabSize": 4,
+        "editor.autoIndent": "advanced",
+        "diffEditor.ignoreTrimWhitespace": false
+    },
     "cpplint.excludes": [
         "3rdparty",
         "build",
diff --git a/cmake/config.cmake b/cmake/config.cmake
index 4ddaf18d1..6fb24498f 100644
--- a/cmake/config.cmake
+++ b/cmake/config.cmake
@@ -20,6 +20,7 @@ if(MSVC)
     set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
 else()
     add_compile_options("-Wall;-Werror;-Wextra;-Wpedantic;-Wno-missing-field-initializers")
+
     if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)
         add_compile_options("-Wno-restrict")
     endif()
diff --git a/cmake/grpc-gen.cmake b/cmake/grpc-gen.cmake
index 072ba73a1..613a76139 100644
--- a/cmake/grpc-gen.cmake
+++ b/cmake/grpc-gen.cmake
@@ -7,11 +7,12 @@ macro(GENERATE_GRPC_LIB LIB_NAME IN_DIR OUT_DIR GEN_SRCS)
 
     foreach(PROTO ${PROTOS})
         string(REGEX REPLACE "^${IN_DIR}" ${OUT_DIR} PROTO_TIMESTAMP ${PROTO})
+
         if(${PROTO} IS_NEWER_THAN ${PROTO_TIMESTAMP}.timestamp)
             message("generate ${PROTO}")
             execute_process(COMMAND ${PROTO_COMPILER} "--proto_path=${IN_DIR}" "--cpp_out=${OUT_DIR}" ${PROTO})
             execute_process(COMMAND ${PROTO_COMPILER} "--proto_path=${IN_DIR}" "--grpc_out=${OUT_DIR}"
-                                    "--plugin=protoc-gen-grpc=${PROTO_GRPC_PLUGIN}" ${PROTO})
+                "--plugin=protoc-gen-grpc=${PROTO_GRPC_PLUGIN}" ${PROTO})
             file(TOUCH ${PROTO_TIMESTAMP}.timestamp)
         endif()
     endforeach()
@@ -22,9 +23,9 @@ macro(GENERATE_GRPC_LIB LIB_NAME IN_DIR OUT_DIR GEN_SRCS)
     target_link_libraries(${LIB_NAME} protobuf::libprotobuf gRPC::grpc++)
     set(${LIB_NAME}_INCLUDE_DIRS ${OUT_DIR})
     set(${GEN_SRCS} ${SRCS})
-    
+
     set_target_properties(${LIB_NAME} PROPERTIES FOLDER "Generated")
-    
+
     source_group("generated" FILES ${SRCS})
     source_group("proto" FILES ${PROTOS})
 endmacro()
diff --git a/cmake/macos.cmake b/cmake/macos.cmake
index b9a883975..16fb9d73b 100644
--- a/cmake/macos.cmake
+++ b/cmake/macos.cmake
@@ -3,35 +3,35 @@ if(BUILD_XCFRAMEWORK)
         OUTPUT MaaFramework.xcframework
         COMMAND rm -rf MaaFramework.xcframework
         COMMAND xcodebuild -create-xcframework -library libMaaFramework.dylib -headers ${PROJECT_SOURCE_DIR}/include
-                -output MaaFramework.xcframework
+        -output MaaFramework.xcframework
         DEPENDS MaaFramework)
 
     add_custom_command(
         OUTPUT OpenCV.xcframework
         COMMAND rm -rf OpenCV.xcframework
         COMMAND
-            xcodebuild -create-xcframework -library
-            "${MAADEPS_DIR}/runtime/${MAADEPS_TRIPLET}/libopencv_world4.408.dylib" -output
-            OpenCV.xcframework)
+        xcodebuild -create-xcframework -library
+        "${MAADEPS_DIR}/runtime/${MAADEPS_TRIPLET}/libopencv_world4.408.dylib" -output
+        OpenCV.xcframework)
 
     add_custom_command(
         OUTPUT ONNXRuntime.xcframework
         COMMAND rm -rf ONNXRuntime.xcframework
         COMMAND
-            xcodebuild -create-xcframework -library
-            "${MAADEPS_DIR}/runtime/${MAADEPS_TRIPLET}/libonnxruntime.1.16.0.dylib" -output
-            ONNXRuntime.xcframework)
+        xcodebuild -create-xcframework -library
+        "${MAADEPS_DIR}/runtime/${MAADEPS_TRIPLET}/libonnxruntime.1.16.0.dylib" -output
+        ONNXRuntime.xcframework)
 
     add_custom_command(
         OUTPUT fastdeploy_ppocr.xcframework
         COMMAND rm -rf fastdeploy_ppocr.xcframework
         COMMAND
-            xcodebuild -create-xcframework -library
-            "${MAADEPS_DIR}/runtime/${MAADEPS_TRIPLET}/libfastdeploy_ppocr.dylib" -output
-            fastdeploy_ppocr.xcframework)
+        xcodebuild -create-xcframework -library
+        "${MAADEPS_DIR}/runtime/${MAADEPS_TRIPLET}/libfastdeploy_ppocr.dylib" -output
+        fastdeploy_ppocr.xcframework)
 
     add_custom_target(MaaXCFramework ALL DEPENDS MaaFramework MaaFramework.xcframework OpenCV.xcframework
-                                                 ONNXRuntime.xcframework fastdeploy_ppocr.xcframework)
+        ONNXRuntime.xcframework fastdeploy_ppocr.xcframework)
 endif(BUILD_XCFRAMEWORK)
 
 target_compile_options(MaaFramework PRIVATE -Wno-deprecated-declarations -Wno-gnu-zero-variadic-macro-arguments)
diff --git a/cmake/thrift-gen.cmake b/cmake/thrift-gen.cmake
index 6fde1243a..606b40b6d 100644
--- a/cmake/thrift-gen.cmake
+++ b/cmake/thrift-gen.cmake
@@ -4,10 +4,12 @@ macro(GENERATE_THRIFT_LIB LIB_NAME FILENAME OUTPUTDIR SOURCES)
     file(MAKE_DIRECTORY ${OUTPUTDIR})
 
     execute_process(COMMAND ${THRIFT_COMPILER} --gen cpp:no_skeleton -out ${OUTPUTDIR} ${FILENAME}
-                    RESULT_VARIABLE CMD_RESULT)
+        RESULT_VARIABLE CMD_RESULT)
+
     if(CMD_RESULT)
         message(FATAL_ERROR "Error generating ${FILENAME} with generator ${GENERATOR}")
     endif()
+
     file(GLOB_RECURSE GENERATED_SOURCES ${OUTPUTDIR}/*.cpp ${OUTPUTDIR}/*.h ${OUTPUTDIR}/*.hpp)
     add_library(${LIB_NAME} STATIC ${GENERATED_SOURCES} ${FILENAME})
     set_target_properties(${LIB_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
@@ -18,7 +20,7 @@ macro(GENERATE_THRIFT_LIB LIB_NAME FILENAME OUTPUTDIR SOURCES)
     set(${SOURCES} ${GENERATED_SOURCES})
 
     set_target_properties(${LIB_NAME} PROPERTIES FOLDER "Generated")
-    
+
     source_group("generated" FILES ${GENERATED_SOURCES})
     source_group("thrift" FILES ${FILENAME})
 endmacro()
diff --git a/cmake/utils.cmake b/cmake/utils.cmake
index 3ce49aae5..a9c75fa3e 100644
--- a/cmake/utils.cmake
+++ b/cmake/utils.cmake
@@ -2,6 +2,7 @@ function(download_and_decompress url filename sha256_checksum decompress_dir)
     if(EXISTS ${filename})
         file(SHA256 ${filename} CHECKSUM_VARIABLE)
     endif()
+
     if(NOT EXISTS ${filename} OR NOT CHECKSUM_VARIABLE STREQUAL sha256_checksum)
         message("Downloading file from ${url} to ${filename} ...")
         file(
@@ -10,9 +11,11 @@ function(download_and_decompress url filename sha256_checksum decompress_dir)
             EXPECTED_HASH SHA256=${sha256_checksum})
         file(RENAME "${filename}.tmp" ${filename})
     endif()
+
     if(NOT EXISTS ${decompress_dir})
         file(MAKE_DIRECTORY ${decompress_dir})
     endif()
+
     message("Decompress file ${filename} ...")
     execute_process(COMMAND ${CMAKE_COMMAND} -E tar -xf ${filename} WORKING_DIRECTORY ${decompress_dir})
 endfunction()
@@ -41,6 +44,7 @@ endif(APPLE)
 if(NOT DEFINED MAADEPS_TRIPLET)
     detect_maadeps_triplet(MAADEPS_TRIPLET)
 endif()
+
 set(MAADEPS_TARGET_TOOLS ${MAADEPS_DIR}/vcpkg/installed/${MAADEPS_TRIPLET}/tools)
 
 if(WIN32)
@@ -50,4 +54,5 @@ elseif(APPLE)
 else()
     set(MAADEPS_HOST_TRIPLET "x64-linux")
 endif()
+
 set(MAADEPS_HOST_TOOLS ${MAADEPS_DIR}/vcpkg/installed/${MAADEPS_HOST_TRIPLET}/tools)
diff --git a/cmake/version.cmake b/cmake/version.cmake
index 1283b9eff..110c177d1 100644
--- a/cmake/version.cmake
+++ b/cmake/version.cmake
@@ -2,9 +2,11 @@
 set(MAA_HASH_VERSION
     "DEBUG_VERSION"
     CACHE STRING "maa version")
+
 if(MAA_HASH_VERSION STREQUAL "DEBUG_VERSION")
     find_package(Git)
 endif()
+
 if(MAA_HASH_VERSION STREQUAL "DEBUG_VERSION" AND GIT_FOUND)
     execute_process(
         COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD
@@ -13,11 +15,13 @@ if(MAA_HASH_VERSION STREQUAL "DEBUG_VERSION" AND GIT_FOUND)
         OUTPUT_VARIABLE output
         ERROR_VARIABLE err
         OUTPUT_STRIP_TRAILING_WHITESPACE)
+
     if(result EQUAL 0)
         set(MAA_HASH_VERSION "${output}")
     else()
         message(WARNING "git rev-parse returning ${result}, output:\n${err}")
     endif()
 endif()
+
 message(STATUS "MAA_HASH_VERSION=${MAA_HASH_VERSION}")
 add_compile_definitions(MAA_VERSION="${MAA_HASH_VERSION}")
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index 9a9091bbe..4e402b596 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -1,15 +1,18 @@
 add_subdirectory(MaaUtils)
 
-if (WITH_ADB_CONTROLLER)
+if(WITH_ADB_CONTROLLER)
     add_subdirectory(MaaAdbControlUnit)
 endif()
-if (WITH_WIN32_CONTROLLER)
+
+if(WITH_WIN32_CONTROLLER)
     add_subdirectory(MaaWin32ControlUnit)
 endif()
+
 if(WITH_THRIFT_CONTROLLER)
     add_subdirectory(MaaThriftControlUnit)
 endif()
-if (WITH_DBG_CONTROLLER)
+
+if(WITH_DBG_CONTROLLER)
     add_subdirectory(MaaDbgControlUnit)
 endif()
 
diff --git a/source/LibraryHolder/CMakeLists.txt b/source/LibraryHolder/CMakeLists.txt
index 106c2a161..716b5e8a8 100644
--- a/source/LibraryHolder/CMakeLists.txt
+++ b/source/LibraryHolder/CMakeLists.txt
@@ -4,22 +4,26 @@ file(GLOB_RECURSE library_holder_header ${MAA_PRIVATE_INC}/LibraryHolder/*)
 add_library(LibraryHolder STATIC ${library_holder_src} ${library_holder_header})
 set_target_properties(LibraryHolder PROPERTIES POSITION_INDEPENDENT_CODE ON)
 
-target_include_directories(LibraryHolder 
+target_include_directories(LibraryHolder
     PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${MAA_PRIVATE_INC} ${MAA_PUBLIC_INC})
 
 target_link_libraries(LibraryHolder MaaUtils HeaderOnlyLibraries Boost::system)
 
 add_dependencies(LibraryHolder MaaUtils)
-if (WITH_ADB_CONTROLLER)
+
+if(WITH_ADB_CONTROLLER)
     add_dependencies(LibraryHolder MaaAdbControlUnit)
 endif()
-if (WITH_WIN32_CONTROLLER)
+
+if(WITH_WIN32_CONTROLLER)
     add_dependencies(LibraryHolder MaaWin32ControlUnit)
 endif()
+
 if(WITH_THRIFT_CONTROLLER)
     add_dependencies(LibraryHolder MaaThriftControlUnit)
 endif()
-if (WITH_DBG_CONTROLLER)
+
+if(WITH_DBG_CONTROLLER)
     add_dependencies(LibraryHolder MaaDbgControlUnit)
 endif()
 
diff --git a/source/MaaAdbControlUnit/CMakeLists.txt b/source/MaaAdbControlUnit/CMakeLists.txt
index 24018d503..0ea5dac67 100644
--- a/source/MaaAdbControlUnit/CMakeLists.txt
+++ b/source/MaaAdbControlUnit/CMakeLists.txt
@@ -7,6 +7,7 @@ target_include_directories(MaaAdbControlUnit
     PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${MAA_PRIVATE_INC} ${MAA_PUBLIC_INC})
 
 target_link_libraries(MaaAdbControlUnit MaaUtils HeaderOnlyLibraries ${OpenCV_LIBS} ZLIB::ZLIB)
+
 if(WIN32)
     target_link_libraries(MaaAdbControlUnit ws2_32)
 endif()
@@ -19,7 +20,8 @@ install(
     TARGETS MaaAdbControlUnit
     RUNTIME DESTINATION bin
     LIBRARY DESTINATION bin
-    #ARCHIVE DESTINATION lib
-    )
+
+    # ARCHIVE DESTINATION lib
+)
 
 source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_adb_control_unit_src})
diff --git a/source/MaaDbgControlUnit/CMakeLists.txt b/source/MaaDbgControlUnit/CMakeLists.txt
index d65e8ea68..7171abb0d 100644
--- a/source/MaaDbgControlUnit/CMakeLists.txt
+++ b/source/MaaDbgControlUnit/CMakeLists.txt
@@ -3,7 +3,7 @@ file(GLOB_RECURSE maa_dbg_control_unit_header ${MAA_PRIVATE_INC}/ControlUnit/Dbg
 
 add_library(MaaDbgControlUnit SHARED ${maa_dbg_control_unit_src} ${maa_dbg_control_unit_header})
 
-target_include_directories(MaaDbgControlUnit 
+target_include_directories(MaaDbgControlUnit
     PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${MAA_PRIVATE_INC} ${MAA_PUBLIC_INC})
 
 target_link_libraries(MaaDbgControlUnit MaaUtils HeaderOnlyLibraries ${OpenCV_LIBS})
@@ -16,7 +16,8 @@ install(
     TARGETS MaaDbgControlUnit
     RUNTIME DESTINATION bin
     LIBRARY DESTINATION bin
-    #ARCHIVE DESTINATION lib
-    )
+
+    # ARCHIVE DESTINATION lib
+)
 
 source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_dbg_control_unit_src})
diff --git a/source/MaaFramework/CMakeLists.txt b/source/MaaFramework/CMakeLists.txt
index 8c2d68211..e501c3d94 100644
--- a/source/MaaFramework/CMakeLists.txt
+++ b/source/MaaFramework/CMakeLists.txt
@@ -11,22 +11,24 @@ target_include_directories(
 target_compile_definitions(MaaFramework PRIVATE MAA_FRAMEWORK_EXPORTS)
 
 target_link_libraries(MaaFramework PRIVATE MaaUtils LibraryHolder ${OpenCV_LIBS} fastdeploy_ppocr
-                                           ONNXRuntime::ONNXRuntime HeaderOnlyLibraries)
+    ONNXRuntime::ONNXRuntime HeaderOnlyLibraries)
 
 # clang 15之后有ranges if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") find_package(range-v3 REQUIRED)
 # target_link_libraries(MaaFramework range-v3::range-v3) endif ()
-
 add_dependencies(MaaFramework MaaUtils LibraryHolder)
 
 if(WITH_ADB_CONTROLLER)
     add_dependencies(MaaFramework MaaAdbControlUnit)
 endif()
+
 if(WITH_WIN32_CONTROLLER)
     add_dependencies(MaaFramework MaaWin32ControlUnit)
 endif()
+
 if(WITH_THRIFT_CONTROLLER)
     add_dependencies(MaaFramework MaaThriftControlUnit)
 endif()
+
 if(WITH_DBG_CONTROLLER)
     add_dependencies(MaaFramework MaaDbgControlUnit)
 endif()
diff --git a/source/MaaProjectInterface/CLI/CMakeLists.txt b/source/MaaProjectInterface/CLI/CMakeLists.txt
index 0881d2067..0101472d3 100644
--- a/source/MaaProjectInterface/CLI/CMakeLists.txt
+++ b/source/MaaProjectInterface/CLI/CMakeLists.txt
@@ -3,7 +3,7 @@ file(GLOB_RECURSE maa_pi_cli_header ${MAA_PRIVATE_INC}/MaaPiCli/*)
 
 add_executable(MaaPiCli ${maa_pi_cli_src} ${maa_pi_cli_header})
 
-target_include_directories(MaaPiCli 
+target_include_directories(MaaPiCli
     PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${MAA_PRIVATE_INC} ${MAA_PUBLIC_INC})
 
 target_link_libraries(MaaPiCli ProjectInterface MaaUtils MaaFramework MaaToolkit HeaderOnlyLibraries Boost::system)
diff --git a/source/MaaProjectInterface/Impl/CMakeLists.txt b/source/MaaProjectInterface/Impl/CMakeLists.txt
index 92ad96147..11e43200f 100644
--- a/source/MaaProjectInterface/Impl/CMakeLists.txt
+++ b/source/MaaProjectInterface/Impl/CMakeLists.txt
@@ -3,7 +3,7 @@ file(GLOB_RECURSE project_interface_header ${MAA_PRIVATE_INC}/ProjectInterface/*
 
 add_library(ProjectInterface STATIC ${project_interface_src} ${project_interface_header})
 
-target_include_directories(ProjectInterface 
+target_include_directories(ProjectInterface
     PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${MAA_PRIVATE_INC} ${MAA_PUBLIC_INC})
 
 target_link_libraries(ProjectInterface MaaUtils HeaderOnlyLibraries Boost::system)
diff --git a/source/MaaThriftControlUnit/CMakeLists.txt b/source/MaaThriftControlUnit/CMakeLists.txt
index 900ff379b..a02708dff 100644
--- a/source/MaaThriftControlUnit/CMakeLists.txt
+++ b/source/MaaThriftControlUnit/CMakeLists.txt
@@ -9,7 +9,7 @@ file(GLOB_RECURSE maa_thrift_control_unit_header ${MAA_PRIVATE_INC}/ControlUnit/
 
 add_library(MaaThriftControlUnit SHARED ${maa_thrift_control_unit_src} ${maa_thrift_control_unit_header})
 
-target_include_directories(MaaThriftControlUnit 
+target_include_directories(MaaThriftControlUnit
     PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${MAA_PRIVATE_INC} ${MAA_PUBLIC_INC})
 
 target_link_libraries(MaaThriftControlUnit MaaUtils ThriftControlUnitThrift HeaderOnlyLibraries ${OpenCV_LIBS})
@@ -22,7 +22,8 @@ install(
     TARGETS MaaThriftControlUnit
     RUNTIME DESTINATION bin
     LIBRARY DESTINATION bin
-    #ARCHIVE DESTINATION lib
-    )
+
+    # ARCHIVE DESTINATION lib
+)
 
 source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_thrift_control_unit_src})
diff --git a/source/MaaWin32ControlUnit/CMakeLists.txt b/source/MaaWin32ControlUnit/CMakeLists.txt
index 35cbf8276..c7a2e6753 100644
--- a/source/MaaWin32ControlUnit/CMakeLists.txt
+++ b/source/MaaWin32ControlUnit/CMakeLists.txt
@@ -17,7 +17,8 @@ install(
     TARGETS MaaWin32ControlUnit
     RUNTIME DESTINATION bin
     LIBRARY DESTINATION bin
-    #ARCHIVE DESTINATION lib
-    )
+
+    # ARCHIVE DESTINATION lib
+)
 
 source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_win32_control_unit_src})


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 9d173f38f..b50ba273a 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -236,11 +236,15 @@ jobs:
 
   macos:
     needs: meta
-    runs-on: macos-latest
     strategy:
       matrix:
-        arch: [x86_64]
+        include:
+          - os: macos-13
+            arch: x86_64
+          - os: macos-14
+            arch: aarch64
       fail-fast: false
+    runs-on: ${{ matrix.os }}
 
     steps:
       - uses: actions/checkout@v3
@@ -249,7 +253,7 @@ jobs:
 
       - name: Install dep
         run: |
-          brew install cmake python ninja
+          brew install cmake ninja
         # ccache?
 
       - name: Install compiler
@@ -263,14 +267,26 @@ jobs:
         run: |
           python3 tools/maadeps-download.py ${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-osx
 
-      - name: Build MAA
+      - name: Build MAA for x86_64
+        if: ${{ matrix.arch == 'x86_64' }}
         env:
           CC: "/usr/local/opt/llvm/bin/clang"
           CXX: "/usr/local/opt/llvm/bin/clang++"
-          LDFLAGS: "-L/usr/local/opt/llvm/lib/c++ -Wl,-rpath,/usr/local/opt/llvm/lib/c++"
         run: |
           cmake --preset 'NinjaMulti' \
-            -DCMAKE_OSX_ARCHITECTURES='${{ matrix.arch == 'x86_64' && 'x86_64' || 'arm64' }}' \
+            -DMAADEPS_TRIPLET='maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-osx' \
+            -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}' \
+            -DWITH_GRPC=OFF -DBUILD_PIPELINE_TESTING=ON -DBUILD_DLOPEN_TESTING=ON
+
+          cmake --build build --preset 'NinjaMulti - Release' -j 16
+
+      - name: Build MAA for aarch64
+        if: ${{ matrix.arch == 'aarch64' }}
+        env:
+          CC: "/opt/homebrew/opt/llvm/bin/clang"
+          CXX: "/opt/homebrew/opt/llvm/bin/clang++"
+        run: |
+          cmake --preset 'NinjaMulti' \
             -DMAADEPS_TRIPLET='maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-osx' \
             -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}' \
             -DWITH_GRPC=OFF -DBUILD_PIPELINE_TESTING=ON -DBUILD_DLOPEN_TESTING=ON
@@ -284,15 +300,11 @@ jobs:
           cmake --install build --prefix install
 
       - name: Run DlopenTesting
-        # TODO: qemu for aarch64
-        if: ${{matrix.arch == 'x86_64'}}
         shell: bash
         run: |
           ./install/bin/DlopenTesting
 
       - name: Run PipelineTesting
-        # TODO: qemu for aarch64
-        if: ${{matrix.arch == 'x86_64'}}
         shell: bash
         run: |
           ./install/bin/PipelineTesting ./install/test
diff --git a/test/dlopen/CMakeLists.txt b/test/dlopen/CMakeLists.txt
index f3441af5e..0fc46c062 100644
--- a/test/dlopen/CMakeLists.txt
+++ b/test/dlopen/CMakeLists.txt
@@ -4,24 +4,27 @@ file(
     *.cpp
     *.h
     *.hpp)
-    
+
 add_executable(DlopenTesting ${dlopen_testing_src})
 
-target_include_directories(DlopenTesting 
+target_include_directories(DlopenTesting
     PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${MAA_PUBLIC_INC} ${MAA_PRIVATE_INC})
 
 target_link_libraries(DlopenTesting LibraryHolder)
 
-if (WITH_ADB_CONTROLLER)
+if(WITH_ADB_CONTROLLER)
     target_compile_definitions(DlopenTesting PRIVATE WITH_ADB_CONTROLLER)
 endif()
-if (WITH_WIN32_CONTROLLER)
+
+if(WITH_WIN32_CONTROLLER)
     target_compile_definitions(DlopenTesting PRIVATE WITH_WIN32_CONTROLLER)
 endif()
+
 if(WITH_THRIFT_CONTROLLER)
     target_compile_definitions(DlopenTesting PRIVATE WITH_THRIFT_CONTROLLER)
 endif()
-if (WITH_DBG_CONTROLLER)
+
+if(WITH_DBG_CONTROLLER)
     target_compile_definitions(DlopenTesting PRIVATE WITH_DBG_CONTROLLER)
 endif()
 
diff --git a/test/pipeline/CMakeLists.txt b/test/pipeline/CMakeLists.txt
index 97c9b1a58..f7d5617df 100644
--- a/test/pipeline/CMakeLists.txt
+++ b/test/pipeline/CMakeLists.txt
@@ -4,7 +4,7 @@ file(
     *.cpp
     *.h
     *.hpp)
-    
+
 add_executable(PipelineTesting ${pipeline_testing_src})
 
 target_link_libraries(PipelineTesting MaaFramework HeaderOnlyLibraries)