Run/Debug iOS-app on M1-Mac with Xcode12.5, very very slow ,unbelievable !

Device : apple m1 Mac-mini

Xcode : 12.5

Debug Task: I have developer-id ,so I can run iOS-App on Mac,not iPhone.

When I run on Mac-mini, device chose (My Mac(Designed for iPad)), it is unbelievable slow, I wait about 10 minutes, it still stuck on launching, and not start.

When I run on iPhone 11, it just cost 40 seconds(I know it is also slow, but acceptable ).

My guess: I use Xcode Marco DYLD_PRINT_STATISTICS_DETAILS to analyze start-time , it turns out to be that it spend a lot of time on "rebase ,binding " and "total debugger pause time". I wonder if or not because of that  I target_link_libraries too many frameworks(about 9).

I have no. clue now ,  Is there anyone  encountered this problem and solved, please give me some advices ,Thank you  so. much  !!!!!

(By the way , my iOS-app bundle size is about 205M )

Here is the screenshot:

Answered by BenjaminLee in 694273022

I am the person who ask this question, today it just fixed (about 5 seconds to launch Application), after I upgrade to Xcode13.0, emmmmmm, have nothing to say, for my view, it's just a BUG of Xcode12.

Ps: when I use Xcode12, I doubt that whether my cmake-projects have loop-target-link,so I check and make sure there's not loop-link. Dyld3 takes so long time ,it's just the bug of Xcode12.

I observe similar behavior when trying to run SpriteKit game. 5 minutes to show initial screen and game is hanging up further on. No problems when running usual apps designed for iPhone or iPad.

My experience with the M1 MacMini vs my 2015 MacBook Pro Quad I7 was concerning. Building an identical project on both (an IOS, Objective-C iPad app) was FASTER on the 2015 MacBook Pro vs M1 Mac mini.

2015 MacBook Pro i7 - 11.9 seconds 2020 M1 MacMini - 16.5 seconds ...???

I had 32 GB of space left on the 16GB M1 MacMini with 256GB Hard Drive

  • and about 660GB on my 16GB MacBook Pro (2015 laptop)

My solution/fix ....though I don't understand why this was an issue ...I had 'only' 32 GB of clear space on the M1 SSD hard drive. But the project is only about 420 MB of files, assets, etc.

I suspected it may have something to do with the disk caching ( the major hangup on the M1 MacMini build was an extremely long time to build the asset catalogue data. After running a disk cleanup utility on the M1 MacMini and cleared up a good 3 GB more space, the build time went from 16 seconds to around 3.7 seconds. Where it was taking just under 12 seconds on the 2015 MacBook Pro.

I used Disk Doctor (from the App Store).. on a whim, and it resulted in a big performance boost...still not sure why.

Accepted Answer

I am the person who ask this question, today it just fixed (about 5 seconds to launch Application), after I upgrade to Xcode13.0, emmmmmm, have nothing to say, for my view, it's just a BUG of Xcode12.

Ps: when I use Xcode12, I doubt that whether my cmake-projects have loop-target-link,so I check and make sure there's not loop-link. Dyld3 takes so long time ,it's just the bug of Xcode12.

Run/Debug iOS-app on M1-Mac with Xcode12.5, very very slow ,unbelievable !
 
 
Q