gpt4 book ai didi

react-native run-android 部署旧版本

转载 作者:行者123 更新时间:2023-12-04 03:09:10 25 4
gpt4 key购买 nike

我正在构建一个 react native android 应用程序。我使用 Windows 作为我的开发区域。要将我的应用程序推送到我的手机,我只需通过 USB 将手机连接到我的电脑,然后运行命令 react-native run-android

这在我的一部安卓手机上运行良好,完全符合预期。

我有第二部较旧的 Android 手机,但每次我运行 react-native run-android 时,它都会收到 2-3 天前的旧版应用程序,当时我上次将​​手机连接到电脑。我尝试从我的手机上手动卸载该应用程序,我尝试重新启动我的手机,我尝试取出电池,但每次部署时,它仍然收到旧版本。

如何让我的第二部安卓手机接收最新版本?

最佳答案

如果你看看他们的 documentation , Reload JS 仅适用于 Android 5 及更高版本的 USB 调试。对于旧设备,您可能想尝试方法 2:

Method 2: Connect via Wi-Fi

You can also connect to the development server over Wi-Fi. You'll first need to install the app on your device using a USB cable, but once that has been done you can debug wirelessly by following these instructions. You'll need your development machine's current IP address before proceeding.

Open a terminal and type /sbin/ifconfig to find your machine's IP address.

Make sure your laptop and your phone are on the same Wi-Fi network. Open your React Native app on your device. You'll see a red screen with an error. This is OK. The following steps will fix that. Open the in-app Developer menu. Go to Dev Settings → Debug server host for device. Type in your machine's IP address and the port of the local dev server (e.g. 10.0.1.1:8081). Go back to the Developer menu and select Reload JS.

You can now enable Live reloading from the Developer menu. Your app will reload whenever your JavaScript code has changed.

关于react-native run-android 部署旧版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46627138/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com