Skip to content

Instantly share code, notes, and snippets.

@badarshahzad
Created October 11, 2018 05:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save badarshahzad/f3081bcb6e621e397de26e38cea58fb0 to your computer and use it in GitHub Desktop.
Save badarshahzad/f3081bcb6e621e397de26e38cea58fb0 to your computer and use it in GitHub Desktop.
Here is the couple commands for the Android & React Native
/*******************
* Android
*******************/
Where is the emuator in your directory:
/root/Android/Sdk/emulator
$> ./emulator -list-avds
/*******************
* React Native
*******************/
$>
@Shoaibkhan786
Copy link

Shoaibkhan786 commented Oct 17, 2018

When you clone someone else react native repo,normally you have to run the packager server with this command to prevent internal server error.
$> react-native start --reset-cache

@badarshahzad
Copy link
Author

badarshahzad commented Oct 17, 2018

React Native init Project:
$> react-native run android
$> react-native start

Expo project:
$> npm start
$> npm run-android
$> expo start

@badarshahzad
Copy link
Author

@badarshahzad
Copy link
Author

@badarshahzad
Copy link
Author

Show mysql databases tables in readable pages pager less -SFX

@badarshahzad
Copy link
Author

To enable React Native logcat as compare to Chrome logs
adb logcat *:S ReactNative:V ReactNativeJS:V

@badarshahzad
Copy link
Author

adb logcat AndroidRuntime:E *:S

@Hassankhan2015
Copy link

echo fs.inotify.max_user_instances=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
echo fs.inotify.max_queued_events=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

this is used when the watch-man is giving unexpected error and react-native project was not loading.

@badarshahzad
Copy link
Author

You can check what versions of dependencies are resolved using gradlew app:dependencies on your android folder. All play-services libs should resolve to the same version, and all support libs should resolve to the same version.

@badarshahzad
Copy link
Author

To kill the demon of the emulator.

Issues like

  • adb server is out of date. killing...
    cannot bind 'tcp:5037': Address already in use ADB server didn't ACK failed to start daemon

  • Error: device offline

badarshahzad:emulator$ netstat -tulpn|grep 5554
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:5554          0.0.0.0:*               LISTEN      14522/qemu-syst

Referance: https://stackoverflow.com/questions/10680417/error-device-offline/15883498

@badarshahzad
Copy link
Author

For IOS $ react-native log-ios
For Android $ react-native log-android

@badarshahzad
Copy link
Author

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
Reference: https://stackoverflow.com/questions/52777413/reactnative-metro-bundler-not-starting-automatically

@badarshahzad
Copy link
Author

react-native run-android --variant=release
react-native run-android --variant=debug

@badarshahzad
Copy link
Author

There is not debug.keystore in android

keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment