React Native 常用Command

New Project

react-native init YourProjectName

#init pod
cd YourProjectName/ios
pod init

插件 (NPM)

安裝插件(NPM)

cd "YourProject"
npm install PluginName --save

移除插件(NPM)

cd "YourProject"
npm uninstall PluginName --save

插件 (Yarn)

安裝插件 (Yarn)

cd "YourProject"
yarn add PluginName --save

移除插件(Yarn)

cd "YourProject"
yarn remove PluginName --save

react-native link PluginName

Testing on Device

iOS

react-native run -ios

Android

#Use adb reverse tcp:8081 tcp:8081 if testing on the device

adb reverse tcp:8081 tcp:8081 
react-native run-android

Release

iOS

react-native bundle --entry-file index.ios.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
react-native run-ios  --variant=release

Android

react-native run-android  --variant=release

Clean out unused Xcode Simulators

xcrun simctl delete unavailable

results matching ""

    No results matching ""