Generate apk from Visual Studio Code - visual-studio-code

Does anyone know any way to generate the .apk file, from Visual Studio Code? Or if it can? Should I sign the application?
The code is based on ionic frame withAngular 4.4.
I have seen many tutorials but they all use the compiler Microsoft Visual Studio. I am using Visual Studio Code.

In vscode use the built in terminal for making .apk with this command :
Debug
ionic cordova build android
Release
ionic cordova build android --release
and use jarsigner to sign the app

highly recommend to read and follow these two articles:
how to setup your machine for Android
https://ionicframework.com/docs/installation/android
how to build app and sign and submit to Google Play:
https://ionicframework.com/docs/publishing/play-store
you do not need specifically VS code’s terminal to run build commands. You just need a terminal.

Yes, you can generate an apk file with VS Code.
Click on Terminal menu then click on New terminal, it is open terminal in vs code in terminal write this command:
ionic cordova build android --prod --release
This commend is using to generate a production app.
ionic cordova build android
This commend is using to generate a debug app.

Related

Running flutter project from visuel studio code

how to launch the execution of a flutter project in chrome instead of the emulator from visual studio code because I have the emulator which does not work.
thank you for helping me.
what i expected to happen :
running app on chrome from visuel studio code
you have to make sure that web is enabled for your project
here's a link to add web support for your current project
https://docs.flutter.dev/get-started/web
once you make sure web is enabled you can just run
flutter run -d chrome

How do I install Flutter app on Android phone?

I couldn't install flutter app on my android phone. How can I do it? I can run by usb debugging However I want to install it on my phone. Can someone help me please?
If you use IntelliJ Idea (it should also work on Android Studio), you can go to
Build -> Flutter -> Build APK, (in the menu bar)
and after building, your apk will appear in
build/app/outputs/flutter-apk/app-release.apk,
just send the file to your phone and install, your phone will probably tell you not do download cause it isn't checked and secured or something, just ignore and install anyway
Connect your Android device to your computer with a USB cable.
Enter cd [project].
Run flutter install.
Source: here
You need to build the app to get the apk. For building apk use this command in console: flutter build apk and if you want to build your apk in smaller size then use this command in console: flutter build apk --split-per-abi.
After building apk you will find it in [project]\build\app\outputs\flutter-apk\app-armeabi-v7a-release.apk here.
If you don't want to build apk and just want to test your app you can run it in profile mode by using this command in console: flutter run --profile.
In android studio under the tools-> build -> build apk will create and app for you and you can get and the output location will show you after the builing the app

how to run an app developed on ionic on the android studio emulator

I am trying to deploy my ionic app to the android studio and run it using the emulator. I have installed the android file into my ionic app. When I try to run it in android studio, this error shows up. Does anybody know why or did I miss out on anything to add to my project? Please help thanks!
You need to go through the Ionic Developer Guide for Android - https://ionicframework.com/docs/developing/android
But to answer your question...
When you build an Ionic project, it generates an Android project (platforms\android on Cordova or android on Capacitor). Open this generated Android project in Android Studio. Then run it from there.

Grandlew bat file not found in windows 10

I have installed flutter and android studio. Followed some resources I have added path.(In windows)
But everytime I run the first project it is giving errors
like. Grandlew bat file not found.
sometimes : exception: exit with 1
Flutter doctor is always giving licenses unknown. I tried number of solutions in the YouTube and from here..but still getting same thing..
My dreams are going to stop in the first step.
you need to install flutter and dart plugin in your android studio/VS code.
to install a plugin in Android Studio follow these steps
Launch Android Studio application
Choose File -> Settings (For Mac Preference )
Search for Flutter then for dart(But dart will be installed automatically with flutter)
I just noticed you don't have Android SDK either, for that, you should go to your android studio and on the top right corner click on the SDK icon, and then install 28/29 version of android SDK hopefully it will solve your problem
alternatively, you can download SDK from here as well

Launch/Test VS Emulator for Android in/from VS Code

I've noticed that Visual Studio has a separate/independent VS Emulator for Android, but I can't figure out how to launch/test their emulator directly from Visual Studio Code. Has anyone used it before? Can anyone tell me how to connect/launch the emulator in/from VS Code?
there is a marketplace plugin for that:
https://marketplace.visualstudio.com/items?itemName=343max.android-emulator-launcher
launch via
Cmd-Shit-P > Launch Android Emulator
you can also create a task to do it:
https://gist.github.com/wbroek/a2caf1ace90eac0c5e25497548f41a6e
and put the task in your debug pipeline (see this: https://www.gamedev.net/articles/programming/general-and-gameplay-programming/android-debugging-with-visual-studio-code-r4820/). this will launch the emulator. to have the emulator open to whatever you're doing, it depends on the framework, etc. For instance, React Native you can use expo for "realtime" updating/debugging (basically just an app that lives on the phone and proxies the compiled code). For full "automated" pipeline, you'd need a task to build your apk, upload it to the phone, then launch apk.