No Supported Devices Connected Flutter Ios

Posted on  by
Contents

Let's fix 3 things shown below: Xcode, VSCode and Connected Device. Xcode: Follow the instructions shown in your screen. You may need to install Xcode, CocoaPods and run xcodebuild. VSCode: Launch VSCode. Click View → Extensions. Install the Flutter Extension for VSCode. Connected Device: Connect our iPhone to the USB port.

For the purpose of simplifying this codelab, delete the Android, iOS, and web support files. These files are not required for Flutter for a desktop application. Deleting the files helps to eliminate accidentally running the wrong variant during this codelab. For macOS and Linux: $ cd githubgraphqlclient $ rm -r android ios web For Windows. Unfortunately flutter not capable for it. Flutter looks good but with adobe air you are able to build and run application on ios device via usb without needing a macos. Adobe has it ages ago ) Google should also able to make that support.

  • Register your app on App Store Connect

This guide provides a step-by-step walkthrough of releasing aFlutter app to the App Store and TestFlight.

Preliminaries

Before beginning the process of releasing your app,ensure that it meetsApple’s App Review Guidelines.

In order to publish your app to the App Store,you must first enroll in theApple Developer Program.You can read more about the variousmembership options in Apple’sChoosing a Membership guide.

Register your app on App Store Connect

Manage your app’s life cycle onApp Store Connect (formerly iTunes Connect).You define your app name and description, add screenshots,set pricing, and manage releases to the App Store and TestFlight.

Registering your app involves two steps: registering a uniqueBundle ID, and creating an application record on App Store Connect.

For a detailed overview of App Store Connect, see theApp Store Connect guide.

Register a Bundle ID

Every iOS application is associated with a Bundle ID,a unique identifier registered with Apple.To register a Bundle ID for your app, follow these steps:

  1. Open the App IDs page of your developer account.
  2. Click + to create a new Bundle ID.
  3. Enter an app name, select Explicit App ID, and enter an ID.
  4. Select the services your app uses, then click Continue.
  5. On the next page, confirm the details and click Registerto register your Bundle ID.

Create an application record on App Store Connect

Register your app on App Store Connect:

  1. Open App Store Connect in your browser.
  2. On the App Store Connect landing page, click My Apps.
  3. Click + in the top-left corner of the My Apps page,then select New App.
  4. Fill in your app details in the form that appears.In the Platforms section, ensure that iOS is checked.Since Flutter does not currently support tvOS,leave that checkbox unchecked. Click Create.
  5. Navigate to the application details for your app and selectApp Information from the sidebar.
  6. In the General Information section, select the Bundle IDyou registered in the preceding step.

For a detailed overview,see Add an app to your account.

Review Xcode project settings

This step covers reviewing the most important settingsin the Xcode workspace.For detailed procedures and descriptions, seePrepare for app distribution.

Navigate to your target’s settings in Xcode:

  1. In Xcode, open Runner.xcworkspace in your app’s ios folder.
  2. To view your app’s settings, select the Runner project in the Xcodeproject navigator. Then, in the main view sidebar, select the Runnertarget.
  3. Select the General tab.

Verify the most important settings.

In the Identity section:

Display Name
The display name of your app.
Bundle Identifier
The App ID you registered on App Store Connect.

In the Signing & Capabilities section:

Automatically manage signing
Whether Xcode should automatically manage app signingand provisioning. This is set true by default, which shouldbe sufficient for most apps. For more complex scenarios,see the Code Signing Guide.
Team
Select the team associated with your registered Apple Developeraccount. If required, select Add Account…,then update this setting.

In the Build Settings section:

iOS Deployment Target
The minimum iOS version that your app supports.Flutter supports iOS 8.0 and later. If your app includesObjective-C or Swift code that makes use of APIs thatwere unavailable in iOS 8, update this setting appropriately.

The General tab of your project settings should resemblethe following:

For a detailed overview of app signing, seeCreate, export, and delete signing certificates.

Updating the app’s deployment version

If you changed Deployment Target in your Xcode project,open ios/Flutter/AppframeworkInfo.plist in your Flutter appand update the MinimumOSVersion value to match.

Updating the app’s version number

The default version number of the app is 1.0.0.To update it, navigate to the pubspec.yaml fileand update the following line:

version: 1.0.0+1

The version number is three numbers separated by dots,such as 1.0.0 in the example above, followed by an optionalbuild number such as 1 in the example above, separated by a +.

Both the version and the build number may be overridden in Flutter’sbuild by specifying --build-name and --build-number,respectively.

In iOS, build-name uses CFBundleShortVersionStringwhile build-number uses CFBundleVersion.Read more about iOS versioning at Core Foundation Keyson the Apple Developer’s site.

Add an app icon

When a new Flutter app is created, a placeholder icon set is created.This step covers replacing these placeholder icons with yourapp’s icons:

  1. Review the iOS App Icon guidelines.
  2. In the Xcode project navigator, select Assets.xcassets in theRunner folder. Update the placeholder icons with your own app icons.
  3. Verify the icon has been replaced by running your app usingflutter run.

Create a build archive

This step covers creating a build archive and uploadingyour build to App Store Connect.

During development, you’ve been building, debugging, and testingwith debug builds. When you’re ready to ship your app to userson the App Store or TestFlight, you need to prepare a release build.At this point, you might consider obfuscating your Dart codeto make it more difficult to reverse engineer. Obfuscatingyour code involves adding a couple flags to your build command.

On the command line, follow these steps in your application directory:

  1. Run flutter build ios to create a release build(flutter build defaults to --release).
  2. To ensure that Xcode refreshes the release mode configuration,close and re-open your Xcode workspace.For Xcode 8.3 and later, this step is not required.

In Xcode, configure the app version and build:

  1. In Xcode, open Runner.xcworkspace in your app’s ios folder.
  2. Select Product > Scheme > Runner.
  3. Select Product > Destination > Any iOS Device.
  4. Select Runner in the Xcode project navigator, then select theRunner target in the settings view sidebar.
  5. In the Identity section, update the Version to the user-facingversion number you wish to publish.
  6. In the Identity section, update the Build identifier to a uniquebuild number used to track this build on App Store Connect.Each upload requires a unique build number.

Finally, create a build archive and upload it to App Store Connect:

  1. Select Product > Archive to produce a build archive.

    Note: On Flutter version 1.24.0-6.0 and later you can create an archive by instead running flutter build ipa. Then open build/ios/archive/MyApp.xcarchive in Xcode to validate and distribute your app. See flutter build ipa -h for available flags.

  2. In the sidebar of the Xcode Organizer window, select your iOS app,then select the build archive you just produced.

  3. Click the Validate App button. If any issues are reported,address them and produce another build. You can reuse the samebuild ID until you upload an archive.

  4. After the archive has been successfully validated, clickDistribute App. You can follow the status of your build in theActivities tab of your app’s details page onApp Store Connect.

    Note: When you export your app at the end of Distribute App, Xcode will create a directory containing an IPA of your app and an ExportOptions.plist file. On Flutter version 1.24.0-6.0 and later you can create new IPAs with the same options without launching Xcode by running flutter build ipa --export-options-plist=path/to/ExportOptions.plist. See xcodebuild -h for details about the keys in this property list.

You should receive an email within 30 minutes notifying you thatyour build has been validated and is available to release to testerson TestFlight. At this point you can choose whether to releaseon TestFlight, or go ahead and release your app to the App Store.

For more details, seeUpload an app to App Store Connect.

Release your app on TestFlight

TestFlight allows developers to push their appsto internal and external testers. This optional stepcovers releasing your build on TestFlight.

  1. Navigate to the TestFlight tab of your app’s applicationdetails page on App Store Connect.
  2. Select Internal Testing in the sidebar.
  3. Select the build to publish to testers, then click Save.
  4. Add the email addresses of any internal testers.You can add additional internal users in the Users and Rolespage of App Store Connect,available from the dropdown menu at the top of the page.

For more details, see Distribute an app using TestFlight.

Release your app to the App Store

When you’re ready to release your app to the world,follow these steps to submit your app for review andrelease to the App Store:

  1. Select Pricing and Availability from the sidebar of your app’sapplication details page onApp Store Connect and complete therequired information.
  2. Select the status from the sidebar. If this is the firstrelease of this app, its status is1.0 Prepare for Submission. Complete all required fields.
  3. Click Submit for Review.

Apple notifies you when their app review process is complete.Your app is released according to the instructions youspecified in the Version Release section.

For more details, seeDistribute an app through the App Store.

Troubleshooting

The Distribute your app guide provides adetailed overview of the process of releasing an app to the App Store.

Note from the editor:At Miquido, we support the community of Flutter lovers and we’re always happy to contribute to knowledge-sharing across the Flutter network. Today, we’re presenting the guest article by Codemagic, who nailed the topic of developing iOS app with Flutter and… with no macOS device. Enjoy every piece of it!

Most of the time, iOS apps are developed and distributed from macOS machines. It’s hard to imagine developing apps for the iOS platform without macOS. However, with the combination of Flutter and Codemagic, you can develop and distribute iOS apps without using macOS. In our previous post, we have explained the process of code signing iOS apps without a Mac. In this post, we will cover in detail the process of developing Flutter apps on Linux and using custom/manual code signing with Codemagic to have full control over app signing on the example of Comagic-Demo app.

Developing Flutter apps on Linux

Flutter is a cross-platform mobile application development framework that enables to develop iOS and Android apps from the same source code. However, Apple’s native frameworks used for developing iOS apps cannot compile on other platforms like Linux or Windows. The native iOS components require a macOS or Darwin for developing and distributing iOS apps. However, technologies like Flutter allow us to develop cross-platform apps on Linux or Windows and we can then distribute the apps to Google Play Store or Apple App Store using the Codemagic CI/CD solution.

Getting a Flutter app on Linux

Android apps can be built, tested and published from the Linux platform. We can take advantage of this Android feature to enable Flutter app development on Linux. Our Flutter app is called Comagic-Demo. We will use that app to show how to build for Android & iOS on Linux. However, keep in mind that, we can only develop against Android on Linux not iOS. We will still get iOS app that can be deployed to App Store while developing Android app on Linux. We can get our Comagic-Demo to Linux using different ways.

Get a Linux machine

If you already have a computer with Linux installed on it, then the whole process is easy. You just have to install Android SDK and Flutter on the Linux machine. Once we clone the Comagic-Demo app, we can start working on it straightway.

Create Docker containers

Another way to get a Flutter app on Linux is by using Docker. If you are familiar with the Docker ecosystem, then you can create a Dockerfile which has Android SDK and Flutter installed. There are many Android Dockerfiles on Dockerhub, we just need to extend those images with Flutter SDK. Let’s create a simple Dockerfile extending a sample Android docker image here to get the Android and Flutter environment into the Docker container. The Dockerfile should copy the app into the container and run the Flutter Android environment. The example Dockerfile for Comagic-Demo will look like this:

This code snippet is just for illustration purposes, but you can customize the Dockerfile as per your needs. Once you have the Dockerfile and Docker installed, you can get the Codemagic-app using Docker.

Once we run these commands, we will have the Docker container running with Flutter environment.

Dockerising Futter apps will be a different topic and we will cover it in details in a future post.

Devices

Generating code signing assets from App Store Connect

In order to code sign iOS apps, you need an Apple developer account, a development and a distribution certificate, your app ID and provisioning profiles created for the app. We have covered the details of code signing activities in a previous post. In order to configure manual code signing for the development or debug builds of iOS apps on Codemagic, we need following things:

  • Development or distribution certificate in .P12 format
  • Downloaded provisioning profile from App Store Connect or Apple Developer portal
  • Bundle identifier of the iOS app

We can download both the certificate and the provisioning profiles from the Certificates, Identifiers and Profiles sections in Apple Developer portal. in

Similarly, we can download the provisioning profiles from the Apple developer portal.

We need both a certificate and a provisioning profile to code sign our iOS app on Codemagic, so save these files for using later.

Updating Xcode project files

Now, we have got all the code signing assets from Apple Developer portal. Next, we need to sort out the Xcode project file so as to use manual code signing with the correct team and provisioning profile. We can do this by using a Ruby script using Xcodeproj Gem or we can just change the following fields in the ios/YOUR_APP.xcodeproj/project.pbxproj file.

  • DevelopmentTeam = YOUR_DEVELOPMENT_TEAM_ID
  • ProvisioningStyle = Manual
  • PROVISIONING_PROFILE_SPECIFIER = NAME_OF_YOUR_PROVISIONING_PROFILE

No Connected Devices Found

In our Codemagic-Demo app, we have to edit the Xcode project file here on GitHub. We have to make sure to make these changes for the debug configuration for internal builds and for the release configuration for App Store builds. Once we set the values in project.pbxproj, we are ready to deploy the iOS app from Codemagic without any issues.

Setting up manual code signing in Codemagic

When developing on Linux, we can only see the state of the Android app as Xcode and iOS tooling can not be installed or run on Linux. There are some ongoing efforts to bring Swift and iOS tooling on Linux but it will take lot of time. When we are ready to distribute the apps, we can easily set up CI/CD for the app using Codemagic, see the Getting Started Guide here. OnCodemagic, we can enable iOS code signing from the Publish section by uploading the certificate and the provisioning profile that we have downloaded from Apple Developer portal. In the Codemagic app, navigate to Settings → Publish → iOS code signing → Manual and upload your certificate and provisioning profile there.

When you now run the build, you will get the iOS app in the form of the IPA file which can be deployed on the provisioned devices. The list of build artifacts on Codemagic will look like this:

As can be seen in the Artifacts section, we got codemagic_demo.ipa as well as dSYMs files for crash reports. We can install this app on any iOS device that had been added to the provisioning profile and test our iOS app. If we see any bugs there, we can always go back to the Linux environment and fix those bugs.

Distributing iOS app to App Store

No Connected Devices Flutter

As of now, we have built the debug version of the iOS app for testing internally. In a similar way, we can distribute the iOS app to the App Store. When we are ready to deploy the app to the App Store, we need to build the app in Release mode. We can do it using the distribution certificate and production provisioning profile. We can generate the certificate and profiles in a similar way. But we have to make sure to choose App Store distribution while creating the provisioning profile.

The distribution provisioning profile will run the iOS app on any device and we don’t need to add the devices explicitly in the provisioning profile. The App Store provisioning profile will look like this:

Once, we have the iOS distribution certificate and the production provisioning profile at hand, we can select the Release mode in theBuild section in Codemagic as shown below.

We have also set the build arguments to release instead of debug. In the Publish section, we need to upload the distribution certificate and the production provisioning profile to generate the App Store version of the app.

No Supported Devices Connected Flutter Ios App

Once Codemagic generates the build artifacts, we can the build to the App Store Connect, formerly known as iTunesConnect, following the App Store guidelines and submit the app for review.

Flutter Test On Ios Device

Conclusion

Flutter No Connected Devices Found

With the combination of a cross-platform mobile application development framework and a magical CI/CD solution like Codemagic, owning a Mac for iOS app development isn’t mandatory at all. There might be some issues in debugging the app while developing for iOS, but it’s completely possible to develop and publish iOS apps to the App Store using the combination of Flutter and Codemagic.