Skip to content

Check Xcode build setting FULL_PRODUCT_NAME for the name of the built app during flutter run#46838

Merged
fluttergithubbot merged 1 commit intoflutter:masterfrom
jmagman:rename
Dec 13, 2019
Merged

Check Xcode build setting FULL_PRODUCT_NAME for the name of the built app during flutter run#46838
fluttergithubbot merged 1 commit intoflutter:masterfrom
jmagman:rename

Conversation

@jmagman
Copy link
Copy Markdown
Member

@jmagman jmagman commented Dec 12, 2019

Description

Users following the iOS deployment instructions to update their app's display name (what gets shown on the home screen under the icon) can no longer flutter run. Xcode sets PRODUCT_NAME to whatever is input to General > Display Name, and that's used to name the My App.app app product (spaces and all).

Since the instructions say to edit the field in Xcode, there's really no way to extrapolate it from the pubspec or anywhere else.

There have been other attempts to avoid running -showBuildSettings for performance reasons, like parsing the Info.plist for the bundle identifier, but that has caused different problems where the build settings/Info.plist get mismatched. And parsing the project file is never a good idea because it can't differentiate between other products the developer adds, like a watch app or non-Flutter framework.

  • Don't hardcode the product name to Runner.app during a run or install. Get it from Xcode build setting FULL_PRODUCT_NAME.
  • Fix the logging regex to handle the actual product name instead of Runner.

This will still work for "legacy" apps called Runner.app or with a display name hard-coded in the Info.plist.

Related Issues

Fixes #41793
See also #9767 (comment)

Tests

Updated:

  • module_test_ios
  • devices_test
  • mac_test
  • simulators_test

Added: project_test.dart tests.

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.

@jmagman jmagman added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. t: xcode "xcodebuild" on iOS and general Xcode project management labels Dec 12, 2019
@jmagman jmagman self-assigned this Dec 12, 2019
@fluttergithubbot fluttergithubbot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Dec 12, 2019
@jmagman jmagman changed the title WIP flutter run checks FULL_PRODUCT_NAME for the path of the built bundle WIP Check Xcode build setting FULL_PRODUCT_NAME for the name of the built app during flutter run Dec 12, 2019
@jmagman jmagman changed the title WIP Check Xcode build setting FULL_PRODUCT_NAME for the name of the built app during flutter run Check Xcode build setting FULL_PRODUCT_NAME for the name of the built app during flutter run Dec 12, 2019
Copy link
Copy Markdown
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

projectDir.path,
]);

FakeAsync().run((FakeAsync time) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

}

// Match the log prefix (in order to shorten it):
// * Xcode 8: Sep 13 15:28:51 cbracken-macpro localhost Runner[37195]: (Flutter) Observatory listening on http://127.0.0.1:57701/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Copy link
Copy Markdown
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks again for taking this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt. platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After app rename, build error: Could not find the built application bundle at build/ios/iphonesimulator/Runner.app

5 participants