Skip to content

feat: read main activity from AndroidManifest.xml automatically - #1967

Merged
thymikee merged 6 commits into
react-native-community:mainfrom
szymonrybczak:feat/readMainActivityAutomatically
Aug 17, 2023
Merged

feat: read main activity from AndroidManifest.xml automatically#1967
thymikee merged 6 commits into
react-native-community:mainfrom
szymonrybczak:feat/readMainActivityAutomatically

Conversation

@szymonrybczak

@szymonrybczakszymonrybczak commented Jun 14, 2023

Copy link
Copy Markdown
Collaborator

Summary:

Fixes: #896

In this PR I created getMainActivity function that reads AndroidManifest.xml file and gets the main activity name.
Before this PR when user changed the main activity they have to manually provide main activity by option --main-activity.

Test Plan:

  1. Clone the repository and do all the required steps from the Contributing guide
  2. Change main activity name.
  3. Run this command:
node /path/to/react-native-cli/packages/cli/build/bin.js run-android

Main activity should be correctly read from AndroidManifest.xml and correctly launched on emulator.

@github-actionsgithub-actionsBot added docs Documentation change feature labels Jun 14, 2023
@szymonrybczak
szymonrybczakforce-pushed the feat/readMainActivityAutomatically branch 2 times, most recently from 3113c8b to bc0ca64CompareJune 14, 2023 09:15
@szymonrybczak
szymonrybczakforce-pushed the feat/readMainActivityAutomatically branch from bc0ca64 to e16ff7eCompareJune 14, 2023 10:55
@szymonrybczak
szymonrybczak marked this pull request as ready for review June 14, 2023 11:16
@szymonrybczak

Copy link
Copy Markdown
CollaboratorAuthor

@cortinico Would you mind looking at this please? 🙏

Comment threadpackages/cli-platform-android/src/config/getMainActivity.ts
Comment threadpackages/cli-platform-android/src/config/getMainActivity.ts Outdated
@thymikee
thymikee merged commit 7342221 into react-native-community:mainAug 17, 2023
@szymonrybczak
szymonrybczak deleted the feat/readMainActivityAutomatically branch August 17, 2023 13:06
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsDocumentation changefeature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auto detect mainActivity from AndroidManifest.xml

4 participants

@szymonrybczak@cortinico@thymikee@TMisiukiewicz