ReactNative 項(xiàng)目編譯過(guò)程
運(yùn)行ReactNative項(xiàng)目編譯,首先要打開(kāi)終端冕象,如果要運(yùn)行g(shù)ithub的demo丁鹉,可以采用如下方式:
1.打開(kāi)終端胆敞,執(zhí)行命令:$ git clone https://github.com/xxx/yyy.git
2.項(xiàng)目下載完成后,終端執(zhí)行命令:$ cd yyy
3.終端繼續(xù)執(zhí)行:$ npm install携悯,執(zhí)行完畢結(jié)果如下圖
4.開(kāi)始執(zhí)行編譯祭芦,終端繼續(xù)執(zhí)行命令:$ react-native run-ios
結(jié)果此時(shí)遇到一個(gè)問(wèn)題,編譯報(bào)錯(cuò)憔鬼,-bash: react-native: command not found
解決辦法:終端執(zhí)行命令:$ sudo npm install -g react-native-cli? 安裝react-native-cli
5.編譯龟劲,運(yùn)行模擬器,執(zhí)行命令:
iOS執(zhí)行命令:$ react-native run-iso
Android執(zhí)行命令:$ react-native run-android
執(zhí)行完畢** BUILD SUCCEEDED **, 模擬器調(diào)用成功轴或。
Running on iOS
$ react-native run-ios