Skip to content

Instantly share code, notes, and snippets.

@gbrits
Last active February 9, 2022 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbrits/ef862893b86b6278808f4c48b4b98ab7 to your computer and use it in GitHub Desktop.
Save gbrits/ef862893b86b6278808f4c48b4b98ab7 to your computer and use it in GitHub Desktop.
Downgrading from Capacitor 3 to Capacitor 2 (for whatever reason)

Step 1.) Delete your iOS, Android & Node modules folder

rm -rf android && rm -rf ios && rm -rf node_modules

Step 2.) Adjust your package.json to include the following:

"@capacitor/android": "^2.4.5",
"@capacitor/core": "2.4.5",
"@capacitor/ios": "^2.4.5",

Step 3.) Install dependencies and add the platform(s) again

npm install
ionic cap add ios
ionic cap add android

Step 3.) Ensure your typescript version is downgraded too

npm i typescript@~3

Step 4.) You must have a build in the www folder, which upgrading to Capacitor may cause havoc for. So, important steps:

npm run build
npx cap sync
npx cap copy ios

Once you go into XCode (ionic cap open ios) go into the App, TARGETS App > Signing & Capabilities & select your team.

Go ahead and prep your iOS for running:

ionic cap run ios --livereload --external --device --consolelogs --verbose

Done. 🚀

Then click the Play button in iOS. I might update this file when I get to the Android bit.

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