8

I am new to Flutter developement. I kept reading, understanding & following Flutter Documentation and has created my first flutter app in Android Studio IDE. It is working fine in android emulators.

Now I want to test application in iOS simulator but I don't know how to generate build for iOS.

Is it possible to generate .ipa through Android Studio IDE? If yes then how can I do that? Also I can not build .apk, what are the steps for that?

Thanks in Advance...

buzzingsilently
  • 1,546
  • 3
  • 12
  • 18
  • AS should list emulators and connected devices. If you select on and debug-run the apo should be started on the selected emulator. You can also use `flutter run` on the command line or `flutter build apk --release` `flutter install` – Günter Zöchbauer May 09 '18 at 12:39
  • 1
    @GünterZöchbauer I am working on linux os, `flutter build apk --release` This command works perfect & gave me release build for Android. Thanks... – buzzingsilently May 09 '18 at 13:31
  • But when I am trying to run `flutter build ios --release` on terminal I receive an error saying `Building for iOS is only supported on the Mac.` Is there any work around to run on linux!? @GünterZöchbauer – buzzingsilently May 09 '18 at 13:33

2 Answers2

15

You can use

flutter build apk --release 
flutter install

To build for iOS you need a Mac, because it depends on XCode to compile parts of the application.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
0

You should first install X-Code and Android Studio (with Flutter settings and SDK enabled) on macOs, then copy your source code there and open with Android Studio.

After that run flutter clean, flutter packages get and flutter build ios commands in order.

If you have used some libraries that are not supported in iOS they must be omitted or replaced in the project (it can be determined by seeing the library's official page on pub.dev).

Then connect the iPhone to mac and if everything is OK it should be visible in device list section, finally press the Run button to finalize required dependencies by downloading from the internet.

Mohsen Emami
  • 2,709
  • 3
  • 33
  • 40