通过命令行手动在 Android 设备上重新加载 React Native 应用程序 [英] Reload a React Native app on an Android device manually via command line

查看:24
本文介绍了通过命令行手动在 Android 设备上重新加载 React Native 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据需要手动强制重新加载我的 React Native 应用程序,而无需物理摇动设备.(我得到了腕管.)

I'd like to manually force a Reload of my React Native app on demand without physically shaking the device. (I'm getting carpal tunnel.)

我知道可以使用 Live Reload/Hot Reload.我正在寻找按需命令行解决方案.

I know that Live Reload / Hot Reload are available. I'm looking for a on-demand command line solution.

推荐答案

使用 cmd 行,您可以向 Android 设备发送命令.

Using the cmd line you can send a command to the Android device.

adb shell input text "RR"

此命令告诉 Android 设备键入字符R"两次,这是在 Android 上重新加载的 React Native 命令.

This command tells the Android device to type the character "R" twice which is the React Native command to Reload on Android.

adb shell 命令具有许多有用的功能,其中许多功能在此处进行了描述:

The adb shell command has many useful features many of which are described here:

ADB Shell 输入事件

打开开发者菜单:

adb shell input keyevent 82

这篇关于通过命令行手动在 Android 设备上重新加载 React Native 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆