【React Native】安裝 Android Apk 而無需連接伺服器的方法

作者: Calpa Liu
字數:52
出版:2017 年 4 月 11 日
分類: React Native 前端開發 React.js
通常情況下,我們使用以下命令來在我們的手機上測試 React Native 應用程式:react-native run-android。然而,這個方法需要將手機連接到電腦上。為了達到無需伺服器的目標,我們可以使用以下指令來實現:
react-native bundle --dev false --platform android --entry-file index.android.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle --assets-dest ./android/app/build/intermediates/res/merged/debug
cd android
./gradlew assembleDebug

參考資料

Build and Install unsigned apk on device without the development server?

想跟上前端開發的最新技術與實戰分享嗎?立即訂閱本站,掌握 React、Vue、TypeScript 等趨勢!
關於 Calpa

Calpa 擅長使用 TypeScriptReact.jsVue.js 建立 Responsive Website。

他積極參與開源社區,曾在 2019 年的香港開源大會上擔任講者,提供工作經驗和見解。此外,他也在 GitHub 上公開分享個人博客程式碼,已獲得超過 300 顆星星和 60 個分支的支持。

他熱愛學習新技術,並樂意分享經驗。他相信,唯有不斷學習才能跟上快速演變的技術環境。

熱門文章

最新文章