YYY
YYY

Reputation: 1779

Developing for iOS device in Windows environment with Flutter

I'm new to Flutter, was just wondering if it's possible.

I've tried building the demo code using intellij with given instruction (https://flutter.io/setup/). It runs well on android device, but can't find the option to compile and run on my iOS device.

Upvotes: 155

Views: 205336

Answers (8)

Maxime Deuse
Maxime Deuse

Reputation: 453

On Windows, you can also use a utility tool named Odevio to :

  • Configure XCode
  • Test your app on the iOS simulator
  • Build an IPA for on device testing
  • Sign and publish your app

First you need to install the Odevio through the website: https://www.odevio.com

Secondly, set up Odevio with your Apple Developer Account : https://odevio-cli.readthedocs.io/en/latest/tutorial/6_configure_app_store_connect.html

Thirdly, in the case you want to build and publish your app for testing and/or for publication, you can select the corresponding build type and create one.

And that's all there is to it.

Upvotes: 3

Suragch
Suragch

Reputation: 512676

You can do your main development on Linux or Windows with Android Studio or Visual Studio Code. Then use git to move the code to macOS to test it with Xcode on an iOS simulator/device and deploy it to the App Store.

You could do all development on macOS but you can't do all development on Linux or Windows. I'm not too pleased with Apple for making overpriced machines and then forcing us to buy them. Since I can't afford a fast Apple computer, I am planning to do most of my development on Linux and then just do testing and deployment on my painfully slow Mac Mini.

Update

It seems like there are more possibilities now. Read the following articles:

Personally, I ended up buying a MacBook Pro for way too much money. I have to admit that it is convenient, but I have done very little up to this point that really required it. I'm doing all of my learning and development in Android Studio and usually use the Android emulator. Every now and then I fire up the iOS simulator, but I haven't been required to.

My advice is to keep using your current system (Windows or Linux) for as long as you are learning and even while you are developing your first Flutter apps. Eventually you may appreciate the convenience of having the iOS Simulator and Xcode on the same machine, but there is certainly no rush.

Upvotes: 123

giorgio79
giorgio79

Reputation: 4209

Now we have Xcode Cloud https://developer.apple.com/xcode-cloud/ so hopefully we will see some decoupling from iOS. If we would have iOS simulator on Windows that would put the crown on Windows iOS development.

Upvotes: 2

elderg
elderg

Reputation: 91

3 years later after the this question was asked:

https://aws.amazon.com/about-aws/whats-new/2020/11/announcing-amazon-ec2-mac-instances-for-macos/

AWS now supports one demand macOS as an EC2 instance. Haven't tested this out myself as this was just released, but hopefully, this can replace the painful little mac mini that's working extra hard without work-life balance XD

Upvotes: 9

emanuel sanga
emanuel sanga

Reputation: 945

I suggest you use a virtual machine to do your thing.. I had a Mojave MacOS installed on my Windows 10 and I had things running smoothly!

A Mojave image can be got from https://getintopc.com/softwares/operating-systems/mac-os-mojave-10-14-1-vmware-image-free-download/

I found this useful as I had some things that I wanted out of the Mac world while I had a dell latitude.

Upvotes: 13

Pouya Samie
Pouya Samie

Reputation: 3723

you can read this article

it uses some tools and CodeMagic to build Flutter app for Ios.

  1. put your app on GitHub (public) and give access to codemagic
  2. then you should build your app using code magic for IOS.
  3. then you should use Cydia Impactor for signing the file that CodeMagic has sent to you
  4. prepare your windows machine by installing libimobiledevice , ideviceinstaller,which.
  5. Modify Flutter code to not looking for Xcode
  6. Running and debugging

I have used this method it works fine you can hot reload and debug your app the downside is you have to enter apple id password in Cydia Impactor which for sure you should use a second apple id and after apple provisioning profile expiring you should sign your code with Cydia Impactor again. but it's so much cheaper than by a Mac or rent one.

Upvotes: 4

Payam Khaninejad
Payam Khaninejad

Reputation: 7996

You could do that with a Mac (or Hackintosh, or VM), but since we don’t have access to a macOS machine we can use one remotely via Codemagic or Travis CI — completely free! (as long as your project is on a GitHub, Bitbucket or GitLab repository).

First, create an account or sign in to codemagic.io.

Then, click the settings (gear) icon next to your app. Scroll down and click on “Build”. Make sure Mode is set to Debug, and select iOS under Build for platforms.

After that, build the app (Start your first build).

Codemagic will send you an .app file via email. Rename it so that it ends with .zip. Extract it, and you’ll get a folder called Runner.app. Create a folder called Payload and place Runner.app there. Finally , compress the folder called Payload — this will be your IPA file (you may rename it to .ipa).

Alternative: Building the app with Travis CI You’ll need to create an account on Travis CI and let it access your GitHub account.

Then, create .travis.yml on the root of your project with the following contents:

 os: osx 
    language: generic 
    before_script: 
     - brew update 
     - brew install --HEAD usbmuxd 
     - brew unlink usbmuxd 
     - brew link usbmuxd 
     - brew install --HEAD libimobiledevice 
     - brew install ideviceinstaller 
     - brew install ios-deploy 
     - git clone https://github.com/flutter/flutter.git -b beta --depth 1 
    script: 
     - flutter/bin/flutter build ios --debug --no-codesign
    cache: 
      directories: 
      - $HOME/.pub-cache
    before_deploy: 
      - pushd build/ios/iphoneos 
      - mkdir Payload 
      - cd Payload 
      - ln -s ../Runner.app 
      - cd .. 
      - zip -r app.ipa Payload 
      - popd

More info

Upvotes: 40

creativecreatorormaybenot
creativecreatorormaybenot

Reputation: 126974

Apple has made compiling of iOS applications exclusively avaible to macOS.

You can read through this answer and thread to look into workarounds for getting it to work on Windows.

Basically there is no other way for Flutter, but Xamarin and NativeScript provide support for it.

Upvotes: 7

Related Questions