@@ -170,23 +170,23 @@ static BOOL strendswith(const char *str, const char *suffix) {
170170 if (!executablePath) return nil ;
171171 const headerType *target_image_header = 0 ;
172172
173+ #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000
173174#if DEBUG
174- // iOS 18.0 之后,优先查找debug.dylib
175- if (@available (iOS 18.0 , *)) {
176- NSString *debugImagePath = [NSString stringWithFormat: @" %@ .debug.dylib" , executablePath];
177- for (uint32_t i = 0 ; i < imageCount; i++) {
178- const char *image_name = _dyld_get_image_name (i);
179- NSString *imagePath = [NSString stringWithUTF8String: image_name];
180- if ([imagePath isEqualToString: debugImagePath]) {
181- target_image_header = (headerType *)_dyld_get_image_header (i);
182- break ;
183- }
184- }
185-
186- if (target_image_header) {
187- return target_image_header;
175+ // Xcode16之后,优先查找debug.dylib
176+ NSString *debugImagePath = [NSString stringWithFormat: @" %@ .debug.dylib" , executablePath];
177+ for (uint32_t i = 0 ; i < imageCount; i++) {
178+ const char *image_name = _dyld_get_image_name (i);
179+ NSString *imagePath = [NSString stringWithUTF8String: image_name];
180+ if ([imagePath isEqualToString: debugImagePath]) {
181+ target_image_header = (headerType *)_dyld_get_image_header (i);
182+ break ;
188183 }
189184 }
185+
186+ if (target_image_header) {
187+ return target_image_header;
188+ }
189+ #endif
190190#endif
191191
192192 for (uint32_t i = 0 ; i < imageCount; i++) {
0 commit comments