iOS Observatory not discovered after 30 seconds. Error launching application on iPhone

5,364

Solution 1

This Error message occur when your iPhone is busy processing something. For example as below.

If you run Flutter doctor you will see message as below.

Error: iPhone X is busy: Fetching debug symbols for iPhone X. Xcode will continue when iPhone X is finished. (code -10)

To confirm I opened xCode -> windows -> Devices and Simulator and it was showing the progress. Let the progress complete and then confirm by running Flutter doctor to make sure there is no error message.

Solution 2

I have encountered the same issue and following this process has fixed the problem for me on 14.7.1 and 14.8:

Uninstall the app
Restart the phone
Open the app using Xcode
Run 'flutter clean' for the project
Now it should work if you run it again.

If it still doesn't work you could try increasing the observatory timeout (the default appears to be 30 seconds):

localUri = await observatoryDiscovery.uri.timeout(const Duration(seconds: 30));

I'm not 100% sure why this problem appears inconsistently, but there is a lot of related discussion at the following link: https://github.com/flutter/flutter/issues/72161

Solution 3

Had the same problem after updating Xcode and running for the first time. As mentioned on the this github issue (https://github.com/flutter/flutter/issues/72161#issuecomment-994653225) I simply:

  • Opened ios/Runner.xcworkspace with the iPhone connected
  • Waited until "Fetching debug symbols" process finished
  • Closed Xcode
  • Run again from IDE and it worked!
Share:
5,364
Marr
Author by

Marr

Nothing special

Updated on January 01, 2023

Comments

  • Marr
    Marr over 1 year

    I'm unable to debug a freshly created app on physical iOS devices when pubspec dependencies reach a certain size, because it causes the "waiting for observatory port" step to timeout after 30 seconds.

    Devices tested: iPhone 12, iPhone 12 Pro

    iOS versions tested: 14.7.1, 14.5

    The app runs properly on emulator but not on ios real device. How do I fix this issue?

  • Daksh Gargas
    Daksh Gargas over 2 years
    If it is just a suggestion, please post it in the comments instead
  • iDevOrz
    iDevOrz over 2 years
    It happened after I was clear about the Xcode cache. This answer is work for me.
  • Micheal C Wallas
    Micheal C Wallas over 2 years
    It's a solution
  • Daksh Gargas
    Daksh Gargas about 2 years
    I didn't downvote it :) As I said, I don't want to. I'm not surprised someone else did. Please read the community guidelines to post an answer: stackoverflow.com/help/how-to-answer
  • テッド
    テッド about 2 years
    Good answer. What I had to do though was unpair the device from 'xCode -> windows -> Devices and Simulator` then repair it and it worked