react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Command (⌘)-R is now recording the simulator in addition to reloading JS (Xcode 12.5)

Open ferrannp opened this issue 3 years ago • 19 comments

Description

Looks like the CMD-R mapping is taken now in XCode 12.5:

Screenshot 2021-05-01 at 19 51 29

React Native version:

N/A.

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Open simulator in XCode 12.5
  2. Press CMD-R to reload JS, the simulator will start recording the screen

I did not find a way to prevent this. Should we map reloading JS to different keys?

ferrannp avatar May 01 '21 17:05 ferrannp

Double R 👍

dulmandakh avatar May 02 '21 14:05 dulmandakh

@dulmandakh It'll record the screen then reload the JS 😢

anhtuank7c avatar May 03 '21 02:05 anhtuank7c

Just Double R, no command key

dulmandakh avatar May 03 '21 02:05 dulmandakh

Double R doesn't work on iOS simulator, I think that only works for Android. As a workaround for now I'm just using CMD+D to open the dev menu and reload it that way

ernestasgobionis avatar May 03 '21 10:05 ernestasgobionis

Hey @dulmandakh ! Double R does not work on iOS simulator. And even if you could... When you were focus in some TextInput, that wouldn't work I guess.

As an alternative:

  • R key in the terminal running the packager
  • CMD+D and Reload as @ernestasgobionis suggested

But I am hoping we can map another CMD+ something in the simulator because I am recording ALL THE TIME by mistake 😂 .

ferrannp avatar May 03 '21 12:05 ferrannp

This is my work around: https://twitter.com/jonstuebe/status/1390384513927184385

jonstuebe avatar May 06 '21 19:05 jonstuebe

Nice! Thank you @jonstuebe !

ferrannp avatar May 08 '21 10:05 ferrannp

How to remapping simulator screen record shortcut

First, open system preferences and open the Keyboard area.

image

Next:

  1. Click on Shortcuts
  2. Click App Shortcuts
  3. Click the plus button

image

  1. Select Other
  2. Shift + Cmd + G
  3. Enter in /Applications/Xcode.app/Contents/Developer/Applications/
  4. Select Simulator App
  5. Enter for Menu Title: "Record Screen"
  6. Click into the keyboard shortcut box and press your desired shortcut (Ex: Cmd + Shift + R)

image


Source: https://twitter.com/jonstuebe/status/1390384513927184385 Thanks @jonstuebe

RodolfoGS avatar May 08 '21 12:05 RodolfoGS

Thanks @jonstuebe Works for me

heyacherry avatar Jun 03 '21 00:06 heyacherry

Thanks @jonstuebe

likontech avatar Aug 16 '21 04:08 likontech

That stops the whole command + R from recording for me, but I still can't refresh with command + R

JeffreyLeeDave avatar Aug 16 '21 19:08 JeffreyLeeDave

@JeffreyLeeDave, not exactly the same, but I added a shortcut on "command + R" to "Shake" the phone (so it opens the menu)

ValterSantosMatos avatar Aug 30 '21 04:08 ValterSantosMatos

Short Answer:

We can remap simulator screen record shortcut following the steps below:

  1. Open Simulator
  2. Right click the icon in the tray
  3. Select Options > Show in Finder
  4. Copy Simulator.app to your /Applications directory
  5. Open System Preferences > Keyboard > Shortcuts
  6. Click App Shortcuts > add [+]
  7. Select the Simulator.app from the list
  8. Enter Menu Title Record Screen (or other name of the Simulator's Shortcut)
  9. Enter Keyboard Shortcut whatever you want
  10. Click Add
  11. Delete Simulator.app from /Applications
  12. Done! The shortcut will still be changeable.

nysamnang avatar Sep 30 '21 09:09 nysamnang

While workarounds are nice this is still a valid issue. So I hope the reload keyboard shortcut will be change in upcoming react native versions?

tijs avatar Sep 30 '21 14:09 tijs

Here's a simpler workaround, i perused the packager source and realized that there are some commands you can send to the bundler via a simple curl request. curl localhost:8081/reload will reload react native.

image

tastycode avatar Oct 27 '21 19:10 tastycode

single R keystroke reloads

sekomer avatar Jun 07 '23 17:06 sekomer

@jonstuebe since Elon broke Twitter, non-users (including me) cannot see your actual solution 😢 Could you please share it here? :)

image

dnlgrgly avatar Nov 13 '23 08:11 dnlgrgly

@dnlgrgly it's the instructions in the comment two posts below Jon's: https://github.com/facebook/react-native/issues/31467#issuecomment-835352650

liamjones avatar Nov 13 '23 09:11 liamjones

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar May 12 '24 05:05 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar May 19 '24 05:05 github-actions[bot]