- Build Mac App With Flutter Iphone
- Flutter For Mac
- Apps Made With Flutter
- Install Flutter On Mac
- Build Mac App With Flutter 2
- Flutter App Builder
- Build Mac App With Flutter Free
- Signing the app
- Building the app for release
- Test the app bundle
- Android release FAQ
Click on browse repository, search for the Flutter plug-in and click ‘install’. Click on ‘Yes’ when prompted to install the Dart plugin. Now click on ‘Restart’. Building Sample App Using Flutter. Please follow the steps outlined below to create a new Project/App. Select File - New - New Flutter Project. The Google team known for its innovative efforts has not limited itself to web and mobile. Flutter for desktop and embedded devices is also in the pipeline. But these two projects are currently being run on an experimental basis. Soon, the official Flutter team will be able to make its dream a reality of driving the complete system UI.
During a typical development cycle,you test an app using
flutter run
at the command line,or by using the Run and Debugoptions in your IDE. By default,Flutter builds a debug version of your app.When you’re ready to prepare a release version of your app,for example to publish to the Google Play Store,this page can help. Before publishing,you might want to put some finishing touches on your app.This page covers the following topics:
Adding a launcher icon
When a new Flutter app is created, it has a default launcher icon.To customize this icon, you might want to check out theflutter_launcher_icons package.
Alternatively, you can do it manually using the following steps:
- Review the Material Design producticons guidelines for icon design.
- In the
<app dir>/android/app/src/main/res/
directory,place your icon files in folders named usingconfiguration qualifiers.The defaultmipmap-
folders demonstrate the correctnaming convention. - In
AndroidManifest.xml
, update theapplication
tag’sandroid:icon
attribute to reference icons from the previousstep (for example,<application android:icon='@mipmap/ic_launcher' ..
). - To verify that the icon has been replaced,run your app and inspect the app icon in the Launcher.
Signing the app
To publish on the Play Store, you need to give your app a digitalsignature. Use the following instructions to sign your app.
Create a keystore
If you have an existing keystore, skip to the next step.If not, create one by running the following at the command line:
On Mac/Linux, use the following command:
On Windows, use the following command:
This command stores the
key.jks
file in your homedirectory. If you want to store it elsewhere, changethe argument you pass to the -keystore
parameter.However, keep the keystore
file private;don’t check it into public source control!Note:
- The
keytool
command might not be in your path—it’spart of Java, which is installed as part ofAndroid Studio. For the concrete path,runflutter doctor -v
and locate the path printed after‘Java binary at:’. Then use that fully qualified pathreplacingjava
(at the end) withkeytool
.If your path includes space-separated names,such asProgram Files
, use platform-appropriatenotation for the names. For example, on Mac/LinuxuseProgram Files
, and on Windows use'Program Files'
. - The
-storetype JKS
tag is only required for Java 9or newer. As of the Java 9 release,the keystore type defaults to PKS12.
Reference the keystore from the app
Create a file named
<app dir>/android/key.properties
that contains a reference to your keystore:Warning: Keep the
key.properties
file private; don’t check it into public source control.Configure signing in gradle
Configure signing for your app by editing the
<app dir>/android/app/build.gradle
file.- Add code before
android
block:With the keystore information from your properties file:Load thekey.properties
file into thekeystoreProperties
object. - Add code before
buildTypes
block:With the signing configuration info:Configure thesigningConfigs
block in your module’sbuild.gradle
file.
Release builds of your app will now be signed automatically.
Note: You may need to run
flutter clean
after changing the gradle file. This prevents cached builds from affecting the signing process.For more information on signing your app, seeSign your app on developer.android.com.
Shrinking your code with R8
R8 is the new code shrinker from Google, and it’s enabled by defaultwhen you build a release APK or AAB. To disable R8, pass the
--no-shrink
flag to flutter build apk
or flutter build appbundle
.Note: Obfuscation and minification can considerably extend compile time of the Android application.
Reviewing the app manifest
Review the default App Manifest file,
AndroidManifest.xml
,located in <app dir>/android/app/src/main
and verify that the valuesare correct, especially the following:application
- Edit the
android:label
in theapplication
tag to reflectthe final name of the app. uses-permission
- Add the
android.permission.INTERNET
permission if your application code needs Internetaccess. The standard template does not include this tag but allowsInternet access during development to enable communication betweenFlutter tools and a running app.
Reviewing the build configuration
Review the default Gradle build file file,
build.gradle
, located in <app dir>/android/app
andverify the values are correct, especially the followingvalues in the defaultConfig
block:applicationId
- Specify the final, unique (Application Id)appid
versionCode
&versionName
- Specify the internal app version number,and the version number display string. You can do this by settingthe
version
property in the pubspec.yaml file. Consult the versioninformation guidance in the versions documentation. minSdkVersion
&targetSdkVersion
- Specify the minimum API level,and the API level on which the app is designed to run.Consult the API level section in the versions documentationfor details.
Building the app for release
You have two possible release formats when publishing tothe Play Store.
- App bundle (preferred)
- APK
Note: The Google Play Store prefers the app bundle format. For more information, see Android App Bundle and About Android App Bundles.
Warning: Recently, the Flutter team has received several reports from developers indicating they are experiencing app crashes on certain devices on Android 6.0. If you are targeting Android 6.0, use the following steps:
- If you build an App BundleEdit
android/gradle.properties
and add the flag:android.bundle.enableUncompressedNativeLibs=false
. - If you build an APKMake sure
android/app/src/AndroidManifest.xml
doesn’t setandroid:extractNativeLibs=false
in the<application>
tag.
For more information, see the public issue.
Build an app bundle
This section describes how to build a release app bundle.If you completed the signing steps,the app bundle will be signed.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,and maintaining additional files to de-obfuscate stack traces.
From the command line:
- Enter
cd <app dir>
(Replace<app dir>
with your application’s directory.) - Run
flutter build appbundle
(Runningflutter build
defaults to a release build.)
The release bundle for your app is created at
<app dir>/build/app/outputs/bundle/release/app.aab
. Gopro hero 7 app for mac.By default, the app bundle contains your Dart code and the Flutterruntime compiled for armeabi-v7a (ARM 32-bit), arm64-v8a(ARM 64-bit), and x86-64 (x86 64-bit).
Test the app bundle
An app bundle can be tested in multiple ways—this sectiondescribes two.
Offline using the bundle tool
- If you haven’t done so already, download
bundletool
from theGitHub repository. - Generate a set of APKs from your app bundle.
- Deploy the APKs to connected devices.
Online using Google Play
- Upload your bundle to Google Play to test it.You can use the internal test track,or the alpha or beta channels to test the bundle beforereleasing it in production.
- Follow these steps to upload your bundleto the Play Store.
Build an APK
Although app bundles are preferred over APKs, there are storesthat don’t yet support app bundles. In this case, build a releaseAPK for each target ABI (Application Binary Interface).
If you completed the signing steps,the APK will be signed.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.
From the command line:
- Enter
cd <app dir>
(Replace<app dir>
with your application’s directory.) - Run
flutter build apk --split-per-abi
(Theflutter build
command defaults to--release
.)
Build Mac App With Flutter Iphone
This command results in three APK files:
<app dir>/build/app/outputs/apk/release/app-armeabi-v7a-release.apk
<app dir>/build/app/outputs/apk/release/app-arm64-v8a-release.apk
<app dir>/build/app/outputs/apk/release/app-x86_64-release.apk
Removing the
--split-per-abi
flag results in a fat APK that containsyour code compiled for all the target ABIs. Such APKs are larger insize than their split counterparts, causing the user to downloadnative binaries that are not applicable to their device’s architecture.Install an APK on a device
Follow these steps to install the APK on a connected Android device.
From the command line:
- Connect your Android device to your computer with a USB cable.
- Enter
cd <app dir>
where<app dir>
is your application directory. - Run
flutter install
.
Publishing to the Google Play Store
For detailed instructions on publishing your app to the Google Play Store,see the Google Play launch documentation.
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 Android,
build-name
is used as versionName
whilebuild-number
used as versionCode
. Pto hr app for mac. For more information,see Version your app in the Android documentation.After updating the version number in the pubspec file,run
flutter pub get
from the top of the project, oruse the Pub get button in your IDE. This updatesthe versionName
and versionCode
in the local.properties
file,which are later updated in the build.gradle
file when yourebuild the Flutter app.Android release FAQ
Here are some commonly asked questions about deployment forAndroid apps.
When should I build app bundles versus APKs?
The Google Play Store recommends that you deploy app bundlesover APKs because they allow a more efficient delivery of theapplication to your users. However, if you’re distributingyour application by means other than the Play Store,an APK may be your only option. Best free software for mac.
What is a fat APK?
A fat APK is a single APK that contains binaries for multipleABIs embedded within it. This has the benefit that the single APKruns on multiple architectures and thus has wider compatibility,but it has the drawback that its file size is much larger,causing users to download and store more bytes when installingyour application. When building APKs instead of app bundles,it is strongly recommended to build split APKs,as described in build an APK using the
--split-per-abi
flag.What are the supported target architectures?
When building your application in release mode,Flutter apps can be compiled for armeabi-v7a (ARM 32-bit),arm64-v8a (ARM 64-bit), and x86-64 (x86 64-bit).Flutter does not currently support building for x86 Android(See Issue 9253).
Flutter For Mac
How do I sign the app bundle created by flutter build appbundle
?
See Signing the app.
How do I build a release from within Android Studio?
In Android Studio, open the existing
android/
folder under your app’s folder. Then,select build.gradle (Module: app) in the project panel:![Mac Mac](/uploads/1/2/6/3/126390505/429268774.png)
Next, select the build variant. Click Build > Select Build Variantin the main menu. Select any of the variants in the Build Variantspanel (debug is the default):
The resulting app bundle or APK files are located in
build/app/outputs
within your app’s folder.- Create a new project
- Create and run
- macOS-specific support
- Entitlements and the App Sandbox
- Plugin support
Desktop support allows you to compile Flutter source codeto a native macOS or Linux desktop app. Flutter’s desktopsupport also extends to plugins—you can install existing plugins that support the macOS or Linux platforms,or you can create your own.
Warning:Work in progress! This page covers desktop support for macOS and Linux, which are available as alpha-quality features in the Flutter dev channel. Windows platform support is still under development.
These platforms still have notable feature gaps, including accessibility support. We strongly recommend that you examine the Desktop shells page in the Flutter wiki to understand known limitations and ongoing work.
Note: To compile a macOS desktop app, you must build the app on a Mac. To compile a Linux desktop app, you must build the app on Linux. If you experience a problem that hasn’t yet been reported, please file an issue and include “desktop:macos” or “desktop:linux” in the title.
Requirements
To create a Flutter app with desktop support, you need thefollowing software:
- Flutter SDK. See theFlutter SDK installation instructions.
- Optional: An IDE that supports Flutter.You can install Android Studio, IntelliJ IDEA,or Visual Studio Code andinstall the Flutter and Dart pluginsto enable language support and tools for refactoring,running, debugging, and reloading your desktop appwithin an editor. See setting up an editorfor more details.
For macOS desktop development,you need the following in addition to the Flutter SDK:
- CocoaPods if you use plugins
For Linux desktop development,you need the following in addition to the Flutter SDK:
Linux installation varies by distro, buton Ubuntu you might use the following command:
Create a new project
You can use the following stepsto create a new project with desktop support.
Set up
At the command line, perform the following commands tomake sure that you have the latest desktop support and thatit’s enabled. If you see “flutter: command not found”,then make sure that you have installed theFlutter SDK and that it’s in your path.
Where __ is either `macos` or `linux`:
To ensure that desktop is installed,list the devices available.You should see something like the following(you’ll see either macOS or Linux, not both):
You might also run
flutter doctor
to see if there areany unresolved issues. It should look something likethe following on macOS:On Linux, you might see something like the following:
If
flutter doctor
finds problems for a platform you don’tsupport, you can ignore those warnings. You don’t haveto install Android Studio and the Android SDK,for example, if you’re writing a Linux desktop app.After enabling desktop support, restart your IDE.You should now see macOS (desktop) or linux (desktop) in the device pulldown.
Note: You only need to execute
flutter config --enable-<platform>-desktop
once. You can always check the status of your configuration using the no-argument flutter config
command.Create and run
Creating a new project with desktop support is no differentthan creating a new Flutter project for other platforms.
Once you’ve configured your environment for desktopsupport, you can create and run a desktop app eitherin the IDE or from the command line.
IDE
After you’ve configured your environment to supportdesktop, make sure you restart the IDE if it wasalready running.
Apps Made With Flutter
Create a new app in your IDE and it automaticallycreates iOS, Android, and desktop versions of your app.(And web, too, if you’ve enabled web support.)From the device pulldown, select macOS (desktop)or linux (desktop) and run your app to see itlaunch on the desktop.
Command line
To create a new app that includes desktop support(in addition to mobile support), run the following commands,substituting
myapp
with the name of your project:To launch your app from the command line,enter one of the following from the topof the package:
Note: If there aren’t any other connected devices, the
-d <platform>
tag is optional.Build a release app
To generate a release build run one of the following commands:
In general, we don’t recommend releasing a desktop app untildesktop support is stable.However, if you’re interested in learning how to publisha Linux app to the Snap Store, seeBuild and release a Linux desktop app.
Add desktop support to an existing app
To add desktop support to an existing project,run the following command in a terminal from theroot project directory:
This adds the necessary files and directories to yourFlutter project.
macOS-specific support
The following information applies only to macOS development.
Entitlements and the App Sandbox
macOS builds are configured by default to be signed,and sandboxed with App Sandbox.This means that if you want to confer specificcapabilities or services on your macOS app,such as the following:
- Accessing the internet
- Capturing movies and images from the built-in camera
- Accessing files
Then you must set up specific entitlements in Xcode.The following section tells you how to do this.
Setting up entitlements
Managing sandbox settings is done in the
macos/Runner/*.entitlements
files. When editingthese files, you shouldn’t remove the originalRunner-DebugProfile.entitlements
exceptions(that support incoming network connections and JIT),as they’re necessary for the debug
and profile
modes to function correctly.If you’re used to managing entitlement files throughthe Xcode capabilities UI, be aware that the capabilitieseditor updates only one of the two files or,in some cases, it creates a whole new entitlementsfile and switches the project to use it for all configurations.Either scenario causes issues. We recommend that youedit the files directly. Unless you have a very specificreason, you should always make identical changes to both files.
If you keep the App Sandbox enabled (which is required if youplan to distribute your app in the App Store), you need to manageentitlements for your application when you add certain pluginsor other native functionality. For instance, using the
file_chooser
plugin requires adding either thecom.apple.security.files.user-selected.read-only
orcom.apple.security.files.user-selected.read-write
entitlement.Another common entitlement is com.apple.security.network.client
,which you must add if you make any network requests.Important: The
com.apple.security.network.server
entitlement, which allows incoming network connections, is enabled by default only for debug
and profile
builds to enable communications between Flutter tools and a running app. If you need to allow incoming network requests in your application, you must add the com.apple.security.network.server
entitlement to Runner-Release.entitlements
as well, otherwise your app will work correctly for debug or profile testing, but will fail with release builds.For more information on these topics,see App Sandbox and Entitlementson the Apple Developer site.
Hardened runtime
If you choose to distribute your application outsideof the App Store, you need to notarize your applicationfor compatibility with macOS 10.15+.This requires enabling the Hardened Runtime option.Once you have enabled it, you need a valid signingcertificate in order to build.
By default, the entitlements file allows JIT for debug builds but,as with App Sandbox, you may need to manage other entitlements.If you have both App Sandbox and Hardened Runtime enabled,you may need to add multiple entitlements for the same resource.For instance, microphone access would require both
com.apple.security.device.audio-input
(for Hardened Runtime)and com.apple.security.device.microphone
(for App Sandbox).Install Flutter On Mac
For more information on this topic,see Hardened Runtime on the Apple Developer site.
Build Mac App With Flutter 2
Plugin support
Flutter on the desktop supports using and creating plugins.
To use a plugin that supports desktop,follow the steps for plugins in using packages.Flutter automatically adds the necessary native codeto your project, as with iOS or Android.
We recommend the following plugins, which have beenupdated to work for macOS and Linux desktop apps:
Use the following links to find all packages on pub.devthat support desktop apps. These links lists all packages,not just plugin packages. (Remember that plugin packages,or plugins, provide an interface to platform-specific services.)
Creating a plugin
Federated plugins are a recent addition toFlutter’s plugin support. They allow you toseparate functionality for different platformsinto different packages; so the Androidimplementation can be in one package,and the macOS implementation in another.Desktop plugins are perfectly suitedto be implemented as part of a federatedplugin. For more information, seethe following resources:
- Developing packages and plugins, including theFederated plugins section.
- How to write a Flutter web plugin, part 2,covers the structure of federated plugins andcontains information applicable to desktopplugins.
- Modern Flutter Plugin Development coversrecent enhancements to Flutter’s plugin support.
Flutter App Builder
Samples and codelabs
- Write a Flutter desktop application
- A codelab that walks you through buildinga desktop app (for macOS and Linux) thatintegrates the GitHub GraphQL API with yourFlutter app.
Build Mac App With Flutter Free
You can run the following samples as desktop apps,as well as download and inspect the source code tolearn more about Flutter desktop support.
- Flutter Gallery running web app, repo
- A samples project hosted on GitHub to help developersevaluate and use Flutter. The Gallery consists of acollection of Material design widgets, behaviors,and vignettes implemented with Flutter.You can clone the project and run Gallery as a desktop appby following the instructions provided in the README.
- Photo Search app
- A sample app built as a desktop application(for both macOS and Linux) that usesthe following desktop-supported plugins:
What’s next
Stay tuned for updates on desktop support!We continue to develop support for macOS,Windows, and Linux.
Watch the Desktop shells page on the Flutter wikifor more information and ongoing updates.