package.json
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios --simulator=iPhone 14 Pro Max",
"ios_device": "react-native run-ios",
"clean-android": "cd android && ./gradlew clean && cd ..",
"androidABBRelease": "cd android && ./gradlew bundleRelease",
"androidAPKRelease": "cd android && ./gradlew assembleRelease",
"clean-install": "npm install --legacy-peer-deps and npx pod-install",
"install-debug": "npm install --legacy-peer-deps && ENABLE_FLIPPER=TRUE npx pod-install",
"start": "react-native start",
"test": "jest",
"test-coverage": "npm run test -- -u --watchAll=false --reporters=default --coverage",
"lint": "eslint .",
"lint-fix": "npm run lint --fix",
"prettier": "npx prettier --write",
"check": "npx prettier --check **/*.{ts,tsx,js,json}",
"prettier-fix": "npx prettier --write **/*.{js,ts,tsx,json} && npx prettier --write *.{js,ts,tsx,json}",
"reset-cache": "npm start -- --reset-cache"
},
"collectCoverageFrom": [
"src/**/*.{ts,tsx}",
"!**/node_modules/**",
"!**/locales/**",
"!src/navigations/**"
],
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
]
// .prettierrc.js
module.exports = {
arrowParens: 'always',
bracketSpacing: true,
singleQuote: true,
trailingComma: 'all',
jsxBracketSameLine: false,
jsxSingleQuote: false,
quoteProps: 'as-needed',
printWidth: 100,
useTabs: true,
tabWidth: 2,
singleAttributePerLine: false,
embeddedLanguageFormatting: 'auto',
proseWrap: 'preserve',
bracketSameLine: true,
endOfLine: 'auto',
};
// .eslintrc.js
/** @format */
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
rules: {
semi: ['error', 'never'],
},
},
plugins: ['prettier', '@typescript-eslint', 'unused-imports'],
extends: [
'@react-native-community',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:prettier/recommended',
'eslint:recommended',
],
env: {
browser: true,
es2021: true,
},
rules: {
'react/jsx-uses-react': 1,
semi: ['error', 'always'],
'no-unused-expressions': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'unused-imports/no-unused-imports-ts': 2,
'react-native/no-inline-styles': 0,
'prettier/prettier': [
'error',
{
'no-inline-styles': false,
},
],
},
overrides: [
{
files: ['*-test.js', '*.spec.js'],
rules: {
'no-unused-expressions': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'unused-imports/no-unused-imports-ts': 2,
},
},
],
};
//Reset cache
npx react-native start --reset-cache
//Go to android folder
cd Android
//Run this commnad to clean gradle
./gradlew clean
//To generate apk file for android app
./gradlew assembleRelease -generate apk
//To generate abb file for android app
./gradlew bundleRelease -generate abb
//Check device connectd with android app
adb devices
//Check tcpip
adb tcpip 8080
//Create connect with tcpip
adb connect device_ip_address:8080
//Kill server
adb kill-server
//Start server
adb start-server
// If server is being blocked
adb reverse tcp:8081 tcp:8081
//Uninstall app from emulator or device
adb uninstall com.myapp
//Run android app after release generate
npm run android -- --mode="release"
// Error spawn
chmod -R 775 android
//Clean cache
npm cache clean
npm cache clean --force // to force
//react-native --reset-cache
npx react-native start --reset-cache
//Pod install
npm pod-install
npx pod install
//Go to bash or zshrc file
sudo vim ~/.bash_profile
sudo ~/.zshrc
vi ~/.zshrc
//Insert
cmd+i
//Come out from bash or zshrc file
Press-> :wq
Xcode short cut key
//Run project
command + r
//clean build
shift+command+k
//build
command+b
//stop
command+.(dot)
//open sidebar area
command+0(zero)
//Utility area
command+shift+y
//open library
command+shift+l