Skip to content

During "flutter build ipa" add validation to check if app is ready for release #97730

Closed

Description

@jmagman

For all of these, either point to the docs, or inline instructions for how to fix it

Example warnings

  1. App icon is still set to default, point to https://docs.flutter.dev/deployment/ios#add-an-app-icon or in-line how to change
  2. App display name is set to package name (the default, probably not right)

Informational output

  1. Build number https://docs.flutter.dev/deployment/ios#updating-the-apps-version-number
  2. Minimum iOS version
  3. App display name
  4. Other settings from https://docs.flutter.dev/deployment/ios#review-xcode-project-settings

Activity

  1. added
    platform-iosiOS applications specifically
    toolAffects the "flutter" command-line tool. See also t: labels.
    t: xcode"xcodebuild" on iOS and general Xcode project management
    P3Issues that are less important to the Flutter project
    on Feb 3, 2022
  2. added
    P1High-priority issues at the top of the work list
    and removed
    P3Issues that are less important to the Flutter project
    on Oct 6, 2022
  3. jmagman commented on Oct 6, 2022

    @jmagman
    MemberAuthor

    @hellohuanlin you can test flutter_gallery
    Screen Shot 2022-10-06 at 3 05 27 PM

    Around here the xcodeBuildResult property should be populated.

    final FlutterCommandResult xcarchiveResult = await super.runCommand();

    From that you can get the build settings from xcodeBuildResult.xcodeBuildExecution.buildSettings.
    IPHONEOS_DEPLOYMENT_TARGET will get you the minimum iOS version.

    You can add property to BuildableIOSApp to the built app Info.plist path, then parse the Info.plist to get the "name" CFBundleExecutable, the version CFBundleShortVersionString, and you could alternatively get MinimumOSVersion instead of from the build settings.
    Similar to:

    final String plistPath = globals.fs.path.join(uncompressedBundle.path, 'Info.plist');
    if (!globals.fs.file(plistPath).existsSync()) {
    globals.printError('Invalid prebuilt iOS app. Does not contain Info.plist.');
    return null;
    }
    final String? id = globals.plistParser.getStringValueFromFile(
    plistPath,
    PlistParser.kCFBundleIdentifierKey,
    );

  4. hellohuanlin commented on Oct 10, 2022

    @hellohuanlin
    Contributor

    The first approach (build_ios.dart) works.

    For the second approach(application_package.dart), I got the following error before hitting the breakpoint:

    Encountered error while creating the IPA:
    error: exportArchive: Failed to register bundle identifier
    error: exportArchive: No profiles for 'io.flutter.examples.gallery' were found
    

    Does this mean that I need to setup Apple dev account (register ID & download profile)?

  5. jmagman commented on Oct 11, 2022

    @jmagman
    MemberAuthor

    Encountered error while creating the IPA:

    Exactly, it means you don't have the right certs installed. For this bug you can ignore that, I think it makes sense to validate when the app archives successfully, even if it fails to create the IPA.

  6. hellohuanlin commented on Oct 17, 2022

    @hellohuanlin
    Contributor

    In case we forgot: another idea is to check entitlements. This may require plugins to publish what permissions they need.

  7. jmagman commented on Oct 17, 2022

    @jmagman
    MemberAuthor

    In case we forgot: another idea is to check entitlements. This may require plugins to publish what permissions they need.

    x-ref #39444

  8. hellohuanlin commented on Oct 27, 2022

    @hellohuanlin
    Contributor

    Idea: check for com.example placeholder identifier, in case developers forget to update

  9. hellohuanlin commented on Nov 7, 2022

    @hellohuanlin
    Contributor

    we may also want to validate the image size of app icons. Xcode gives warning about the wrong size, but developers may directly replace images without using Xcode (me, for example).

    Screen Shot 2022-11-07 at 11 36 54 AM

  10. hellohuanlin commented on Nov 18, 2022

    @hellohuanlin
    Contributor

    @jmagman another idea is to validate if splash screen (Default.png) is still using template file. Our template seems to be an empty image rather than Flutter icon, so it may be easier for devs to overlook.

  11. jmagman commented on Dec 2, 2022

    @jmagman
    MemberAuthor

    Thanks for all the work on these PRs, @hellohuanlin! I'm going to close this meta issue, we can open new individual issues as needed.

  12. github-actions commented on Mar 5, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  13. locked as resolved and limited conversation to collaborators on Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listplatform-iosiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions