question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

platform-ios run iOS getProductName broken in xCode 12

See original GitHub issue

Description

xCode 12 is escaping equal signs in the build output that is parsed here, this regex will not match the new format:

https://github.com/react-native-community/cli/blob/7238b2057b9c5004b46c01854ea05a61e4a3a3d1/packages/platform-ios/src/commands/runIOS/index.ts#L444

Example of the relevant line in xCode 12 build output:

export FULL_PRODUCT_NAME\=AppName.app

Current Regex: /export FULL_PRODUCT_NAME="?(.+).app"?$/m Working Regex: /export FULL_PRODUCT_NAME\\?="?(.+).app"?$/m

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
nathellcommented, Oct 3, 2020

I’m also hitting this.

Additional quirk is, in my case, the FULL_PRODUCT_NAME contains an exclamation mark. Which means that even if the regex is replaced as suggested by @fuchstim, it won’t work for me, because Xcode actually outputs

export FULL_PRODUCT_NAME\=Example\!.app

(note the \!) when the app is actually named Example!.

So the proper solution would need to unescape all backslash-escaped characters, not just the \=. Or, better yet, to call out to the shell, since this is Bourne shell syntax:

sh -c 'export FULL_PRODUCT_NAME\=Example\!.app; echo ${FULL_PRODUCT_NAME%.app}'
Example!

(Not sure how to do this, since I’m not a Node person).

As a local workaround, I’ve monkey-patched node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/index.js and edited getProductName (lines 339–342) to read:

function getProductName(buildOutput) {
  const productNameMatch = /export FULL_PRODUCT_NAME\\?="?(.+).app"?$/m.exec(buildOutput);
  return productNameMatch ? productNameMatch[1].replace(/(?:\\(.))/g, '$1') : null;
}
0reactions
WilbertJanneycommented, Jun 7, 2021

I opted to link the images from the Images.xcassets package in iOS to fix the images missing in IPA problem for now until the script issue is fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xcode 11.4 : Building for iOS Simu… | Apple Developer Forums
In Xode 11.4, I encounter a failure in my project. When running my project, it was successfull in Xcode 11.3. Now in Xcode...
Read more >
iOS 12 not supported by Xcode 9.4 : Could not locate device ...
I have Xcode 9.4 and iPhone 5S with iOS 12.0 updated. Here are steps I did: 1) Download Xcode_10.1_Beta_2.xip file from Apple; 2)...
Read more >
@react-native-community/cli-platform-android Build failed with ...
Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 1s error Failed to install the app....
Read more >
Common Build Problems - Travis CI Docs
Common Build Problems. My tests broke but were working yesterday; My build script is killed without any error; My build fails unexpectedly; Segmentation...
Read more >
Diff - 996328bb8eeea7e3b824a7cf4c156640600d9778^2 ...
-1,2 +0,0 @@ -# run PlatformIO builds -platformio run ... Inc. nor the names of its -# contributors may be used to endorse...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found