Skip to content

Conversation

adamTrz
Copy link
Collaborator

@adamTrz adamTrz commented Feb 13, 2023

Summary:

  • interactive mode for iOS and Android -> user now can select valid scheme and configuration (iOS) or buildVariant (Android) and desired device to run the app on

run-ios-interactive

run-android-interactive

  • support for Android build flavours

run-android-interatcive-flavours

  • some minor fixes and bit of refactoring 🤓

Tested scenarios:

  • run-ios:
    • no devices connected -> works, picked up default scheme and configuration and run on first available device ✅
    • simulator booted -> works, picked up booted simulator ✅
    • --mode Release -> works ✅
    • --mode Bar -> works, app failed to build because there's no Bar configuration available ✅
    • --configuration Release -> works with warning that configuration is deprecated ✅
    • --list-devices works and user can select device from list ✅
    • --interactive works and lets user pick up valid scheme and configuration and device to run on ✅
  • run-android:
    • no device connected -> works, picked up first available AVD and launched the app ✅
    • emulator booted -> works correctly ✅
    • --mode Release -> works correctly ✅
    • --configuration Release -> works with a warning ✅
    • --list-devices -> works and lets user pick up available device/AVD ✅
    • --interactive -> works correctly ✅
    • with build flavours:
      • --mode UatRelease -> works and uses selected build variant both to build and install the app ✅
      • --interactive -> works and lets user pick up available buildVariant and device or AVD ✅
      • --mode Release -> works (app failed to build because there's no Release buildVariant available, it emits an error and lists all available buildVariants) ✅

image


To test it locally clone the repo, checkout to my branch and run run-ios --interactive / run-android --interactive commands.
To check build flavours support for Android add those lines into your android/app/build.gradle file:

    flavorDimensions.add("version")

    productFlavors {
        prod {
            dimension "version"
        }
        uat {
            dimension "version"
        }
    }

@TMisiukiewicz
Copy link
Collaborator

TMisiukiewicz commented Feb 14, 2023

info Building (using "xcodebuild -workspace NewsApp.xcworkspace -configuration Debug copy -scheme NewsApp -destination id=2C862218-D036-441F-A053-C54C049487FA")

info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/docs/commands.md#doctor 

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening NewsApp.xcworkspace.

image

noticed that configuration name in Xcode can contain more than one word, and if it's selected it ends up with an error. Putting this argument in the quote should do the trick, but we should check if there are any other arguments that can have more than one word (both platforms) and fix them too

Good job 👏

@adamTrz adamTrz force-pushed the feat/interactive-mode branch from 9adff64 to 9516c72 Compare February 17, 2023 09:49
@adamTrz
Copy link
Collaborator Author

adamTrz commented Feb 17, 2023

info Building (using "xcodebuild -workspace NewsApp.xcworkspace -configuration Debug copy -scheme NewsApp -destination id=2C862218-D036-441F-A053-C54C049487FA")

info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/docs/commands.md#doctor 

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening NewsApp.xcworkspace.

image

noticed that configuration name in Xcode can contain more than one word, and if it's selected it ends up with an error. Putting this argument in the quote should do the trick, but we should check if there are any other arguments that can have more than one word (both platforms) and fix them too

Good job 👏

It works for me @TMisiukiewicz, have you installed pods after creating new configuration? 🙂

@TMisiukiewicz
Copy link
Collaborator

@adamTrz you are right, forgot the pods step! All good ✅

Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@szymonrybczak szymonrybczak left a comment

Choose a reason for hiding this comment

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

🚀

@thymikee thymikee merged commit 9d17728 into react-native-community:main Feb 20, 2023
@adamTrz adamTrz deleted the feat/interactive-mode branch February 20, 2023 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants