Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open flutter plugins at Xcode?

I want make some changes in plugin. For android part everything is clear. But how can I open iOs part of plugin? There are no Xcode project just several .h and .m files.

How to open iOs plugin at Xcode?

https://github.com/flutter/plugins/tree/master/packages/video_player/video_player/ios

like image 498
otopba Avatar asked Dec 09 '19 20:12

otopba


People also ask

How do I use Flutter in Xcode?

Open the default Xcode workspace in your project by running open ios/Runner.xcworkspace in a terminal window from your Flutter project directory. Select the device you intend to deploy to in the device drop-down menu next to the run button. Select the Runner project in the left navigation panel.

Can I open Flutter project in Xcode?

Note! Unlike Android studio, flutter isn't supported to XCode yet, you have to open iOS folder of Flutter project only and solely.

Do you need Xcode for Flutter?

Flutter is a multi-platform application development framework that enables you, among other platforms, to develop iOS and Android apps from the same source code. However, you need to use Xcode to build an iOS app and Xcode will only work on macOS.


3 Answers

First, be sure to run the example app at least once.

$ cd example
$ flutter run

Then open the project in Xcode. The Xcode project is in example/ios. The swift (or obj-c) code that implements the iOS end of the method channel is found in (replace the italic strings with the actual plugin name):

Pods/Development Pods/plugin_name/../../example/ios/.symlinks/plugins/plugin_name/ios/Classes

which you can find by opening the tree in the left pane.

like image 110
Richard Heap Avatar answered Oct 31 '22 06:10

Richard Heap


go to root of package then.
cd example
flutter build ios --no-codesign
Launch Xcode.
Select File > Open, and select the hello/example/ios/Runner.xcworkspace file.

The iOS platform code for your plugin is located in Pods/Development Pods/hello/../../example/ios/.symlinks/plugins/hello/ios/Classes in the Project Navigator.

like image 28
ke Chankrisna Avatar answered Oct 31 '22 04:10

ke Chankrisna


The quickest way to open Xcode is xed ios when you are in the root project directory.

The plugins are put in $project_dir/ios/Pods

The plugins are actually installed by running pod install. flutter run will call pod install for you while also building the app. If you want to save time, just run cd ios; pod install and don't build your app.

like image 43
Ben Butterworth Avatar answered Oct 31 '22 04:10

Ben Butterworth