xcode 使用flutter在simctl上拒绝权限

x6h2sr28  于 2023-04-22  发布在  Flutter
关注(0)|答案(1)|浏览(182)

我正在使用Flutter,并在iOS模拟器的帮助下构建一个应用程序。
当我运行flutter doctor时,我得到以下错误:

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.11, on macOS 13.3.1 22E261 darwin-arm64, locale en-DE)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

Error executing simctl: 71
xcrun: error: can't exec '/Applications/Xcode.app/Contents/Developer/usr/bin/simctl' (errno=Permission denied)

[!] Xcode - develop for iOS and macOS (Xcode 14.3)
    ✗ Xcode requires additional components to be installed in order to run.
      Launch Xcode and install additional required components when prompted or run:
        sudo xcodebuild -runFirstLaunch
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] VS Code (version 1.77.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

我不能再构建应用程序了。我以前从未遇到过类似的问题。
我使用以下版本:

flutter --version
Flutter 3.7.11 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f72efea43c (24 hours ago) • 2023-04-11 11:57:21 -0700
Engine • revision 1a65d409c7
Tools • Dart 2.19.6 • DevTools 2.20.1
xcodebuild -version
Xcode 14.3
Build version 14E222b

我已经执行了sudo xcodebuild -runFirstLaunch,它什么也没做。
flutter clean也没有帮助。
我重新安装了Xcode和Flutter,但它没有帮助。

laik7k3q

laik7k3q1#

问题是我不是自己Mac上的管理员。我通过以下方式解决了这个问题:
1.打开System Settings
1.转到Users & Groups
1.点击我的帐户旁边的“信息”按钮。
1.激活Allow this user to administer this computer
1.注销并使用我的用户重新登录。
在这些步骤之后,我能够运行xcrun simctl list而没有错误,flutter doctor不再显示任何错误。

相关问题