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

作者: Calpa Liu
字數:111
出版:2017 年 4 月 11 日
分類:React Native前端開發React.js
react-nativebundle--devfalse--platformandroid--entry-fileindex.android.js--bundle-output./android/app/build/intermediates/assets/debug/index.android.bundle--assets-dest./android/app/build/interm…

⚠️ 時效警告:本文發佈於 2017 年,文中提到的 index.android.js 入口檔案已在 React Native 0.59 移除,文中指令在新版本無法執行。內容保留作為歷史紀錄,指令與連結已不可用。

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?

關於 Calpa

Calpa 擅長使用 TypeScript、React.js 和 Vue.js 建立 Responsive Website。

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

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

熱門文章