albert659 / react_capacitor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:
    • image\
    • you need to change webDir from 'www' to 'build' as shown\
    • image
  • Then run npm run build to make build of your app.
  • Then write npx cap add android to make you app for android or write npx 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šŸ˜Š.

About


Languages

Language:JavaScript 30.2%Language:HTML 27.7%Language:Java 27.1%Language:CSS 15.0%