Convert ReactJs website into an Android/IOS App using Capacitor.js
- Firstly create an react app using:
npx create-react-app appname
- Then install capacitor.js by writing:
npm install @capacitor/cli @capacitor/core
- After installing capacitor.js use the following command:
npx cap init
- This will ask Appname and Appid
- After initilizing capacitor.js a file named
capacitor.config.json
will be added into your root folder looks something like this: - Then run
npm run build
to make build of your app. - Then write
npx cap add android
to make you app for android or writenpx cap add ios
to make yor app for ios. - Then write
npx cap open android
to open it on android studio. Make sure that Android Studio is installed on your system. - Make apk using Android Studio and your react app is ready to useš.