Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Note on connecting to React Native simulator. #3214

Merged
merged 4 commits into from Jul 29, 2022

Conversation

meatnordrink
Copy link
Contributor

Standalone react-devtools frequently has trouble connecting to a running simulator instance, as noted in the docs, on the GH repo, and on SO.

Often, it is necessary to run adb reverse tcp:8097 tcp:8097 to get standalone react-devtools to connect to a running simulator instance. It would be helpful to note this in the docs here, rather than forcing users to search the GH docs, and SO. (Also, a note - the GH docs state that this is only necessary when not using a local emulator, but this is not the case, as evidenced by the aforementioned SO question, where the user notes using an emulator, and in my own experience - I must do this to get react-devtools to connect to an Android Studio emulator, which I assume would count as a local emulator.)

@facebook-github-bot
Copy link

Hi @meatnordrink!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@netlify
Copy link

netlify bot commented Jul 18, 2022

Deploy Preview for react-native ready!

Name Link
🔨 Latest commit c845c16
🔍 Latest deploy log https://app.netlify.com/sites/react-native/deploys/62dfc797d14e3e00090823b7
😎 Deploy Preview https://deploy-preview-3214--react-native.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@cortinico
Copy link
Contributor

as noted in the docs, on the GH repo

Could you link the docs you're referring to?

@meatnordrink
Copy link
Contributor Author

@cortinico - Sure! Thanks for taking a look at this. Here's what I was referring to:

https://github.com/facebook/react/tree/main/packages/react-devtools

...it should connect to your simulator within a few seconds. (If this doesn't happen automatically, try reloading the React Native app.)
and
If you're not using a local simulator, you'll also need to forward ports used by React DevTools:

I was also looking at the React Native Debugging section; the only relevant bit they say to this is

It should connect to your simulator within a few seconds.

Looking at these, I'm realizing they're not as explicit references to linking failures as I'm remembering them as; there was probably some lingering frustration around the amount of time spent getting them to connect (and the solution being in conflict with that first documentation link, where it says it's only necessary when not using a local emulator) when I wrote this, so perhaps I was seeing more explicit references to difficulties than they really are (e.g., perhaps I was interpreting "should" more significantly than it was meant in the second example). My apologies if that's the case.

Looking at them again, though, with the SO issue, it does seem to suggest that getting them to link is a common problem. And the fact that when I asked our (admittedly new and small) React-Native mobile team how to connect them, no one had been able.

@cortinico
Copy link
Contributor

And the fact that when I asked our (admittedly new and small) React-Native mobile team how to connect them, no one had been able.

The reason why I've asked more references is because I'm aware of how emulators on Android 12 seems to restrict port forwarding and users have to adb reverse more often. I'm wondering if you're facing this issue only on a Android 12 emulator or not.

As a rule of thumb, I think we can include this instruction, but maybe inside a :::note block as a troubleshooting suggestion?

@meatnordrink
Copy link
Contributor Author

meatnordrink commented Jul 21, 2022

@cortinico Ah, I didn't know that! Thank you for enlightening me! I am indeed using an Android 12 simulator (Pixel 5 API 31, Android 12.0 Google APIs).

I made it a > note: block, per your suggestion. I also added a bit about it being particular to Android 12. I personally think that's great to include, because it sort of names the difficulty, rather than just making it seem like the React devTools are randomly buggy. I think that can increase developer confidence and peace of mind - sort of make it less likely we're in a mindset of just waiting for it to randomly stop working again - and make independent debugging more likely in the future, by putting it in developer's heads that trying a different simulator may address the issue.

This does result in two >note: blocks in a row; perhaps less than ideal. I'm open to other formatting suggestions; feel free to edit it to something you think flows/looks better.

Thank you again for the insight, and for looking at this!

Copy link
Contributor

@leotm leotm left a comment

Choose a reason for hiding this comment

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

good stuff

docs/debugging.md Outdated Show resolved Hide resolved
Co-authored-by: LeoTM <1881059+leotm@users.noreply.github.com>
@meatnordrink
Copy link
Contributor Author

Thanks @leotm ; suggestion accepted!

docs/debugging.md Outdated Show resolved Hide resolved
Co-authored-by: Nicola Corti <corti.nico@gmail.com>
@meatnordrink
Copy link
Contributor Author

Looks good, @cortinico ; suggestion applied!

@cortinico cortinico merged commit 0eb8af7 into facebook:main Jul 29, 2022
sunnylqm added a commit to reactnativecn/react-native-website that referenced this pull request Sep 6, 2022
* Add a few Microsoft apps to the showcase (facebook#3203)

* fix artsy icon

* add microsoft office mobile

* add outlook mobile

* add teams

* add xbox

* remove placeholder link

* Correct minor mistake in native-components-android.md (facebook#3210)

* Update fast-refresh.md (facebook#3208)

Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

* Fixed Artsy logo and infoLink of oculus in webiste/showcase (facebook#3199)

* Wrap "Android SDK Build-Tools" with backticks (facebook#3206)

* Update keyboardavoidingview.md (facebook#3202)

* Update debugging.md (facebook#3209)

* Add the blogpost for Hermes as the Default engine (facebook#3212)

* Add the blogpost for Hermes as the Default engine

* Update website/blog/2022-07-08-hermes-as-the-default.md

Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

* Update website/blog/2022-07-08-hermes-as-the-default.md

Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

Co-authored-by: Nicola Corti <corti.nico@gmail.com>
Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

* Update iOS data in Hermes default blog post (facebook#3216)

* Update the contributing section docs (facebook#3221)

Co-authored-by: Nicola Corti <corti.nico@gmail.com>
Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

* Bump terser from 5.12.1 to 5.14.2 (facebook#3219)

Bumps [terser](https://github.com/terser/terser) from 5.12.1 to 5.14.2.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: add build tools to Table of Contents (facebook#3228)

* Update build-speed.md (facebook#3223)

Removed duplicated sentence from docs

* Remove Uber Eats from showcase (facebook#3229)

* docs: add two sections to the New Architecture (facebook#3230)

* Note on connecting to React Native simulator. (facebook#3214)

Co-authored-by: LeoTM <1881059+leotm@users.noreply.github.com>
Co-authored-by: Nicola Corti <corti.nico@gmail.com>

* Fix a couple of problems on the release runbook (facebook#3222)

* Improving UX: replace videos and links with SnackPlayers, update examples (facebook#3231)

* Fix extra whitespace on debugging.md (facebook#3233)

* Add more info to Prerequisites for Libraries guide (facebook#3238)

* Add spaces in the example

* Add section about codegen types

* Correct section title

* Add information about requireNativeComponent

* [Docs] iOS Simulator version & UDID (facebook#3225)

Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

* Add retrospective as a copilot responsibility (facebook#3242)

* update release related docs page (facebook#3240)

* update crew composition and remove testers/supporters

* add note about testing async

* Update website/contributing/release-roles-responsibilites.md

Co-authored-by: Riccardo <riccardo.cipolleschi@gmail.com>

* Update website/contributing/release-roles-responsibilites.md

Co-authored-by: Riccardo <riccardo.cipolleschi@gmail.com>

* refactor note into a snipper

* Update website/contributing/release-roles-responsibilites.md

Co-authored-by: Marek Fořt <marekfort@me.com>

* yarnlock change?

* clean up document based on feedback

* more words at the start

Co-authored-by: Riccardo <riccardo.cipolleschi@gmail.com>
Co-authored-by: Marek Fořt <marekfort@me.com>

* Update image.md (facebook#2850)

This is missing, but this is an important information. Imagine a view sized 100x150 and an image sized 200x300. The old description could be interpreted in a way, that the image doesn't scale at all!

* Fix lint

* chore: Specify return vs resolve (facebook#3236)

When dealing with functions which return Promises, it's helpful to be clear about whether something _returns_ a value, or whether the returned Promise will _resolve to_ a value.

* update Docusaurus and other dependencies (facebook#3218)

* Add kotlin examples in new-architecture-app-modules-android.md (facebook#3241)

* change links in main home (facebook#3244)

* Refactoring The New Architecture Guide (facebook#3037)

* [Do Not Merge] Refactoring The New Architecture (facebook#3029)

* [Guide - The New Architecture] What Backward Compatibility Is (facebook#3038)

* Guide to creating a New Architecture app from template (facebook#3056)

* Start new template guide

This is a first iteration. I want to get feedback on a few aspects, so
starting from here as a baseline.

* Update title

* Use tabs for target OS

Set up matching the style of "Getting Started", except I kept the
headers inside the tabs for now as it makes for a useful right-hand TOC.

* Capitalize New Architecture, simplify

* Preliminary section for Hermes

Add section for recommending enabling Hermes. Not sure of contents yet,
and still have to test.

* Reword to emphasize importance of Hermes usage

* Show new arch in use

* Add build speed article link

* Add pro tip for pod install alias

* Restructure, repeat less

Favor linking to original setup guide instead of repeating content.

* Note about Expo

* Include command on uninstalling global CLI

* How to learn more

* Remove headers in tabs

They don't work correctly with the righthand TOC.

* Make header more clear

* Use quote block less often

There was way too much yellow.

* Opt for instructions using XCode

Because `xcodebuild clean` already failed me once when XCode GUI clean
worked.

* Fix lint issue

* Improve wording

* Use product name

* Fix line wraps

* Reword based on feedback

* Note use of bundle install

* Pod removal instructions

Also standardize on using yarn scripts from template for commands, it's
a little confusing to see the mix of `npx` and `yarn` once we start
referring to `yarn pod-install`

* Convert quotes to admonitions

* Convert Note: to admonitions

* Feedback: Change admonitions to caution

* PR feedback

* New Architecture landing page (facebook#3072)

* First draft of landing page

* Add migration and backwards compatibility links

* lint fix

* Restructure slightly, leaning more on context from Why a New Architecture

* Don't need md in links

* Suggested rewording

* Rephrase pillar summaries

* [Guide - The New Architecture] Why A New Architecture (facebook#3043)

* [Guide - The New Architecture] Pillars (facebook#3046)

* [Guide - The New Architecture] TurboModules as Native Modules (facebook#3039)

* [Guide - The New Architecture] Fabric Components as Native Components (facebook#3040)

* [FEAT][TNA] Fabric Component Guide (facebook#3132)

* [Feat] Add intro for Fabric Components

* feat: add guide to create a Fabric Component

* Add page on codegen (facebook#3155)

* [FEAT] TurboModules guide (facebook#3168)

* [Feat] Add intro for Fabric Components

* feat: add guide to create a Fabric Component

* Beginning of guide/folder structure

* WIP JS Spec

* specification section

* Configuration

* native code intro

* Must be named Spec

* Best stab at iOS native code, but I don't know how to describe what's going on in the code very well. Extrapolated what I could.

* Android instructions

iOS isn't working for me. Builds, but can't load module.

Writing up Android auto-linking next because the steps I tested did
work.

* Include linking instructions from RNNArch repo

* Add example JavaScript

* native modules link

* Address quick feedback items

* Remove, fix for rebased branch

* fix TM parameter on Android

* Revert to 'Codegen' casing

* Revert folly version change

2021.07.22 is for current version on main

* fix typo

* getTurboModule explainer

* Sentence edits

- Fix acronym bolding
- Change wording to "recommended" because "standard" has other
  connotations of possibly being required
- Parentheses unnecessary, distracting

* Remove TODO for now

Getting inconsistent results here, not sure if this is wrong or not;
removing TODO for now so it doesn't block anything

* ABI rephrase, more in line with new Fabric guide wording

* Explain shared C++ code more

* feat: add guide to create a Fabric Component

* feat: add guide to create a Fabric Component

* package.json description

* Lint fixes

* fix: Move JS constants to reduce changes

* fix: Remove newline

* feat: add required step for Android Codegen

* fix: use the proper links

Co-authored-by: Riccardo Cipolleschi <cipolleschi@fb.com>

* wip: migration guide review (facebook#3200)

Co-authored-by: Lizzi Lindboe <lindboe@users.noreply.github.com>

* fix: Fix typo in the sidebar (facebook#3247)

* Delete ubereats.png (facebook#3246)

Redundant image data

* Fixed pod install instructions (facebook#3243)

* Fixed pod install instructions

Yarn must be run prior to pod install, otherwise pod install fails with "Error: Cannot find module 'mkdirp'"

* yarn start is not necessary anymore

* Refer to rntester readme

* Update android studio screenshot (facebook#3253)

* Adding Android 13 Permissions into PermissionsAndroid (facebook#3254)

* TextInput: Add cursorColor Android prop (facebook#3255)

* Update Android Studio screenshot (Windows) (facebook#3257)

* docs (releases): small refactoring and updating templates (facebook#3256)

* Update documentation for keyboard events on Android (facebook#3259)

facebook/react-native@1e48274 fixed keyboard events on Android 11+ when an activity has set `android:windowSoftInputMode` to `adjustNothing`. Update the documentation to reflect the change.

* Update to Docusaurus stable release, fix alert admonition styling (facebook#3248)

* Change asks to ask (grammar) (facebook#3262)

* contributing: remove old references (facebook#3263)

* adding accessibilityLabelledBy to documentation (facebook#3249)

* Update references to Expo / Expo CLI (facebook#3267)

* feat(images): Adding iOS Image Cache Limits (facebook#3258)

Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

* feat: update instructions around automatic linking (facebook#3269)

* Follow up from facebook#3267 with minor fixes (facebook#3270)

* nit: fix typo in new architecture docs (facebook#3261)

* fix typo

* fix: typescript example

* fix: lint

* make text optional

* fix(images): move app-transport-security reference (facebook#3271)

* fix(images): move app-transport-security reference

* feat(images): updating link references

* fix(network): change network app transport security reference

* fix(docs): updating versioned docs link reference

* Showcase page refresh (facebook#3235)

Co-authored-by: Lorenzo Sciandra <lorenzo.sciandra@gmail.com>

* fix: moving the Using forwardRef and Using a getter to a lower hierarchy level (facebook#3282)

* Upgrade toast Android example to camelCase (facebook#3283)

* Fix link in Introduction (facebook#3290)

* Fix link in Introduction

* Use new page title (potentially renaming that is a separate discussion)

* fix: push steps in a lower hierarchy level (facebook#3296)

* fix type in the new architecture pillars section (facebook#3297)

* cut 0.70 docs (take 2) (facebook#3295)

* Blog post for 0.70 RN release (facebook#3298)

* Blog post for 0.70 RN release

* Fixes and TOC

* Update my GH handle

* Update my GH handle

* Apply suggestions from code review

Co-authored-by: Riccardo <cipolleschi@fb.com>

* Update @Titozzz Twitter handle

* Add example for javaPackageName

* Update commits count

* Minor fixes to the wording

Co-authored-by: Dmytro Rykun <dmitry.rykun@gmail.com>
Co-authored-by: Riccardo <cipolleschi@fb.com>

Co-authored-by: Lorenzo Sciandra <notkelset@kelset.dev>
Co-authored-by: Marcin Kozubek <mkozubek@protonmail.com>
Co-authored-by: Malachi Gruenhagen <68450431+nurse-the-code@users.noreply.github.com>
Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>
Co-authored-by: Pushkar Yadav <96358784+pushkarydv@users.noreply.github.com>
Co-authored-by: Muhammad Ovi (Owais) <muhammadowaisnaseem@gmail.com>
Co-authored-by: rj-jones <85085648+rj-jones@users.noreply.github.com>
Co-authored-by: fbmal7 <105675860+fbmal7@users.noreply.github.com>
Co-authored-by: Nicola Corti <corti.nico@gmail.com>
Co-authored-by: neildhar <neildhar@users.noreply.github.com>
Co-authored-by: Lorenzo Sciandra <lsciandra@microsoft.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yvan Zhu <i@zhuyunfeng.com>
Co-authored-by: Mileta Dulović <dulovicmileta1@gmail.com>
Co-authored-by: Ricky <rickhanlonii@fb.com>
Co-authored-by: Andrew <35735666+meatnordrink@users.noreply.github.com>
Co-authored-by: LeoTM <1881059+leotm@users.noreply.github.com>
Co-authored-by: Nicola Corti <ncor@fb.com>
Co-authored-by: Oskar Kwaśniewski <oskarkwasniewski@icloud.com>
Co-authored-by: Furkan Arabacı <furkanarabaci@hotmail.com>
Co-authored-by: Marek Fořt <marekfort@me.com>
Co-authored-by: Riccardo <riccardo.cipolleschi@gmail.com>
Co-authored-by: Władysław Raczek <wsw.raczek@gmail.com>
Co-authored-by: Luna Wei <luwe@fb.com>
Co-authored-by: Evan Charlton <evancharlton@gmail.com>
Co-authored-by: Tushar Varshney <110495886+tusharvars@users.noreply.github.com>
Co-authored-by: Riccardo <cipolleschi@fb.com>
Co-authored-by: Lizzi Lindboe <lindboe@users.noreply.github.com>
Co-authored-by: Jessej Samuel <1234jessej@gmail.com>
Co-authored-by: Seph Soliman <seph@seph.dk>
Co-authored-by: Kimiyasu Morikawa <mail@alea12.net>
Co-authored-by: Agastya Darma <gedeagas22@gmail.com>
Co-authored-by: Nick Gerleman <nick@nickgerleman.com>
Co-authored-by: denis-tsoi-mox <67885203+denis-tsoi-mox@users.noreply.github.com>
Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com>
Co-authored-by: Brent Vatne <brentvatne@gmail.com>
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
Co-authored-by: nishan (o^▽^o) <nishanbende@gmail.com>
Co-authored-by: Lorenzo Sciandra <lorenzo.sciandra@gmail.com>
Co-authored-by: Lucas Alves <lcsjalves@gmail.com>
Co-authored-by: dan <dan.abramov@gmail.com>
Co-authored-by: Dmytro Rykun <dmitry.rykun@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants