[Labs] Hands-on Capacitor JS

ainan@kayumanis:~$ npx @capacitor/cli create
npx: installed 56 in 5.476s
? App name the_capacit
? App Package ID (in Java package format, no dashes) id.my.ainan
? Directory for new app capacit

⚡️ Welcome to Capacitor (CLI v2.4.6) ⚡️

✔ Creating app the_capacit in capacit with id id.my.ainan in 11.44ms
✔ Installing dependencies in 7.65s
✔ Copying capacitor.js to web dir in 1.83ms
✔ copy in 3.52ms

🎉 Your Capacitor project is ready to go! 🎉

Next steps:

cd ./capacit

Add platforms using “npx cap add”:

npx cap add android
npx cap add ios
npx cap add electron

Follow the Developer Workflow guide to get building:
https://capacitorjs.com/docs/basics/workflow

ainan@kayumanis:~$ cd ./capacit
ainan@kayumanis:~/capacit$ npx cap add android
✔ Installing android dependencies in 3.84s
✔ Adding native android project in: /home/ainan/capacit/android in 46.34ms
✔ Syncing Gradle in 258.90μp
✔ add in 3.89s
✔ Copying web assets from www to android/app/src/main/assets/public in 3.13ms
✔ Copying native bridge in 791.46μp
✔ Copying capacitor.config.json in 718.43μp
✔ copy in 9.39ms
✔ Updating Android plugins in 546.62μp
Found 0 Capacitor plugins for android:
✔ update android in 7.62ms

Now you can run npx cap open android to launch Android Studio
ainan@kayumanis:~/capacit$ npx cap open android
[info] Opening Android project at /home/ainan/capacit/android
[error] Unable to launch Android Studio. You must configure “linuxAndroidStudioPath” in your capacitor.config.json to point to the location of studio.sh, using JavaScript-escaped paths:
Example:
{
“linuxAndroidStudioPath”: “/usr/local/android-studio/bin/studio.sh”
}
ainan@kayumanis:~/capacit$ npx cap open android
[info] Opening Android project at /home/ainan/capacit/android

Catatan Sementara:

Capacitor ini cukup menyenangkan sebagai hybrid framework berbasis teknologi web. Potensinya cukup besar karena bisa memanfaatkan plugin milik Cordova dan juga menggunakan UI framework dari Ionic. Tapi perlu update ilmu web yang cukup modern (dan tidak sedikit) agar bisa menggunakan secara optimal.

Referensi Lanjut:

Published
Categorized as labs Tagged

By Ainan

Siapalah saya... Entah kenapa aku menulis disini, aku sudah lupa. Karena semua ini pada awalnya adalah sesuatu yang tidak seharusnya menjadi seperti sekarang. Aku hanya merasa bahwa ada hal yang benar-benar ingin aku lakukan dengan menulis disini. Samar-samar aku ingat, tapi selebihnya lagi aku sudah tidak tahu itu apa dan bagaimana harus melakukannya.

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.