Cli: Command to reload Android / iOS simulator

Created on 10 Apr 2019  Â·  10Comments  Â·  Source: react-native-community/cli

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.

feature request

Most helpful comment

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"

All 10 comments

CC: @pbitkowski

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.

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

@pbitkowski, were you able to look into that issue? I am trying to get an
idea whether we can ship it in next React Native or not.

>

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.

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

Sounds good, I was just referring to his previous estimation.

On Wed, 17 Apr 2019 at 11:23, Michał Pierzchała notifications@github.com
wrote:

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

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/react-native-community/cli/issues/308#issuecomment-484007785,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACWcxrhjXoStFuw249iUEt2u9nOXoVsfks5vhugdgaJpZM4cn2ob
.

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"

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.

Was this page helpful?
0 / 5 - 0 ratings