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

Command to reload Android / iOS simulator #308

Closed
grabbou opened this issue Apr 10, 2019 · 12 comments
Closed

Command to reload Android / iOS simulator #308

grabbou opened this issue Apr 10, 2019 · 12 comments

Comments

@grabbou
Copy link
Member

grabbou commented Apr 10, 2019

Describe the Feature

Users should be able to run react-native reload in order to reload Android / iOS devices. The behaviour for reloading is different now on every platform and can be tricky to perform in some cases (e.g. no physical menu button on Android).

Possible Implementations

There is one implementation that we should look at before implementing, CC: @TheSavior.

Before sending the code, please look at platform-ios and platform-android packages to see how to provide platform-specific commands.

@grabbou
Copy link
Member Author

grabbou commented Apr 10, 2019

CC: @pbitkowski

@grabbou
Copy link
Member Author

grabbou commented Apr 10, 2019

We should consider doing a Jest-like mode, when running start command would also allow you to press certain letters in order to achieve an action. E.g. r for reload or running an iOS simulator.

@pbitkowski
Copy link

Thanks for documenting this feature, @grabbou . I'll work on it this week.

@grabbou
Copy link
Member Author

grabbou commented Apr 16, 2019 via email

@pbitkowski
Copy link

I weren't able to do so. I will work on that, but I don't think so that it will be ready for 0.60.

@thymikee
Copy link
Member

I second to @pbitkowski if we want to create a reliable watch mode, this is gonna take a while and I wouldn't rush it

@grabbou
Copy link
Member Author

grabbou commented Apr 17, 2019 via email

@thymikee
Copy link
Member

Bump: react-native-community/discussions-and-proposals#134 (comment)

@iremlopsum
Copy link

I have had aliases to reload and shake android for awhile now, never figured out how to do it for iOS, but maybe my android commands will help

alias shake="adb -d shell input keyevent 82"
alias reload="adb -d shell input keyevent KEYCODE_MENU && adb -d shell input keyevent ENTER && adb -d shell input keyevent ENTER"

@thymikee
Copy link
Member

thymikee commented Mar 9, 2020

It's available since CLI v3.x as "watch mode" where you can press "r" in terminal with Metro server running to reload the app.

@thymikee thymikee closed this as completed Mar 9, 2020
@yashaka
Copy link

yashaka commented May 11, 2023

@thymikee is there a way to reload it "remotely", for example from different terminal, maybe via some get response by curl, etc?

@szymonrybczak
Copy link
Collaborator

Hey @yashaka, you can trigger that by invoking endpoint localhost:8081/reload, and then all apps connected to Metro bundler should reload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants