I previously used AppCode quite a lot to maintain some Flutter plugins' iOS code (but switched jobs and didn't need AppCode or Xcode). However, I recently started making a free app, and also wanted to contribute to a Flutter plugin for iOS, I wanted AppCode again. I got AppCode working again, so I wanted to share.
In your flutter directory:
- For editing/debugging/running Flutter apps' iOS code: run
appcode ios
- For Flutter plugins, run
appcode example/ios
(not appcode ios
)
Some principles:
- The files don't show up immediately, use Command + Shift + O to find your file. Then Opt + F1 to show it in the project navigator.
- Built at least once using
flutter run
or Xcode (to make sure configuration is set up).
- You cannot escape Xcode. Xcode and AppCode are complementary. Find the balance . Refactoring code, debugging the application, searching and reading code works really well in AppCode. Xcode does reading configuration better or debugging builds.
- If you get random errors (e.g. everything fails but the error is
build failed
in AppCode, you should open in Xcode or build/run the flutter app for iOS: flutter run
and read the error messages.
- If you want to debug both Flutter and iOS simultaneously, start the iOS debugger, then "Flutter attach" in android studio (maybe this is possible in VSCode too, but I don't use that).
Here's an example screenshot of AppCode with debugger working. You might be curious if telemetry flag you set in Flutter was actually being set in the iOS side... maybe there's a bug. But I take privacy seriously and confirm the telemetry is disabled. I also watch network traffic sometimes. . If you're interested, you can then follow that to it's dependencies (manually, using by reading package.swift
), and find out it is set to true by default.
UserDefaults.standard.register(defaults: [
#keyPath(UserDefaults.MGLMapboxMetricsEnabled): true
])
