1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

iOS強化月間 - iOSアプリ開発の知見を共有しよう -

【Flutter】Android StudioでiPhone実機がDeviceの候補に出なくなったときの対処法

Posted at

背景

Xcodeをアンインストール、再インストール後、Android StudioからiPhone実機が読み込まれなくなった。

確認項目

上から順に試してみてほしい

  • Andorid Studioを再起動する
  • iPhoneを再起動
  • iPhoneがデベロッパーモードに切り替えられているか確認する
  • XcodeとFlutterが連携できているか

iPhoneがデベロッパーモードに切り替えられているか

iPhoneのデベロッパーモードがOFFの場合、Android Studioはデバイスの検知をしてくれないため、デベロッパーモードへ切り替える

切り替え方の参考記事

XcodeとFlutterが連携できているか

初期設定でFlutterとXcodeを連携するコマンドを入力する必要がある。
まずはflutter doctorで現在の連携状況を見てみる

$ flutter doctor
[✓] Flutter (Channel stable, 3.3.6, on macOS 13.5.1 22G90 darwin-arm, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[!] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
[✓] Chrome - develop for the web
[!] Android Studio (version 2022.3)
    ✗ Unable to find bundled Java version.
[!] Android Studio (version 2022.2)
    ✗ Unable to find bundled Java version.
[✓] VS Code (version 1.82.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

[!]はFlutterと連携ができていない項目

[!] Xcode - develop for iOS and macOS

エラーメッセージに従って、コマンドを入力

$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
$ sudo xcodebuild -runFirstLaunch

もう一度flutter doctor

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.6, on macOS 13.5.1 22G90 darwin-arm, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[!] Android Studio (version 2022.3)
    ✗ Unable to find bundled Java version.
[!] Android Studio (version 2022.2)
    ✗ Unable to find bundled Java version.
[✓] VS Code (version 1.82.2)
[✓] Connected device (3 available)
    ! Error: KaitoのiPhone14Pro is busy: Fetching debug symbols for KaitoのiPhone14Pro. Xcode will continue when KaitoのiPhone14Pro is finished. (code -10)
[✓] HTTP Host Availability

これにより実機が読み込まれるようになりました。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?