In the Android world for a long time, feel the incomparable charm. Now, I stand at the entrance of ReactNative and watch out for the world.

[Project Address (effect display)]

Reference documentation

ReactNative Chinese: ReactNative. Cn ReactNavigation: reactNavigation.org Redux Chinese document: cn.redux.js.org/ redux-saga Chinese document: Leonshi.com/redux-saga-…

Use the API

Dry goods concentration camp API Zhihu Daily API

Common commands

The following command applies only to Windows platforms

  1. View connected devices:

    adb devices

  2. To see the list of Android emulators:

    android list avd

  3. Set name to start the emulator:

    emulator -avd [name]

  4. Deploy Apk and run:

    react-native run-android

  5. Open the Developer menu [Ctrl+M] :

    adb shell input keyevent 82

  6. Enabling the Packager service [Operation 4 When apK is deployed, the Packager service is also enabled]

    react-native start

  7. Android platform JS package to generate bundle file:

    react-native bundle –platform android –entry-file index.android.js –reset-cache –bundle-output android/app/src/main/assets/index.android.bundle –dev false –assets-dest android/app/src/main/res/

    (1) — Entry js file, android system is index.android.js, (3) –platform (4) –assets — dest (5) –dev (dev) –dev (dev) –dev (dev) –dev (dev) We set it to false when typing the official installation package

  8. Debug mode link:

    http://localhost:8081/debugger-ui

Recommend a ReactNative plug-in, without the need to enter various command lines github.com/smuyyh/Reac…

Yarn and React Native command line tool (React-native-CLI)

Yarn is a tool provided by Facebook to replace NPM and accelerate the download of node modules. React Native’s command-line tools are used to perform tasks such as creating, initializing, updating projects, and running packager services.

npm install -g yarn react-native-cli

After yarn is installed, set the image source as follows:

yarn config set registry registry.npm.taobao.org –global

yarn config set disturl npm.taobao.org/dist –global

If you encounter an EACCES: Permission denied permission error, try running the following command (Linux only) : sudo NPM install -g yarn react-native-cli.

After yarn is installed, you can use yarn to replace NPM. For example, use yarn to replace NPM install, and use yarn add to replace NPM install –save the name of a third-party library.

Note: There is a problem in NPM5 (the latest version is 5.0.4 at the time of publication) that when installing a new library, other libraries will be deleted, which causes the project to fail to run properly. Use YARN instead of NPM.