简体   繁体   English

如何使用 IONIC 在没有 Android Studio 的情况下生成 android apk

[英]How to generate android apk without Android Studio using IONIC

I have created an app in ionic framework.我在离子框架中创建了一个应用程序。 Now i want to generate APK of my code without using Android Studio.现在我想在不使用 Android Studio 的情况下生成我的代码的 APK。 But i am getting this error.但我收到了这个错误。

[ERROR] An error occurred while running git rev-parse HEAD (exit code 128) [ERROR] 运行 git rev-parse HEAD 时出错(退出代码 128)

will you please help me.你能帮帮我吗? I haven't use ionic before.我以前没用过离子。

I followed this link: https://medium.com/@dineshuthakota/how-to-generate-android-apk-without-android-studio-using-ionic-b3a2ae0edc86我点击了这个链接: https://medium.com/@dineshuthakota/how-to-generate-android-apk-without-android-studio-using-ionic-b3a2ae0edc86

The instructions on the link you used, are not correct.您使用的链接上的说明不正确。

Since it's cordova, you need to add platform in your app as well.由于它是 cordova,因此您还需要在应用程序中添加平台。 cd into your project folder and run the following command in root/folder in terminal: cd 进入您的项目文件夹并在终端的根/文件夹中运行以下命令:

ionic cordova platform add android

Then run:然后运行:

ionic cordova build android

Try this link for instructions: https://ionicframework.com/docs/v1/guide/publishing.html尝试此链接获取说明: https://ionicframework.com/docs/v1/guide/publishing.html

after adding cordova platform with添加 cordova 平台后

ionic cordova platform add android (for android users)
ionic cordova platform add ios     (for ios users)

you can run,你可以跑,

ionic cordova run android -lc (for android users)
ionic cordova run ios -lc (for ios users)

For mac a setup guide: https://ionicframework.com/docs/v3/developer-resources/platform-setup/mac-setup.html对于 mac 设置指南: https://ionicframework.com/docs/v3/developer-resources/platform-setup/mac-setup.html

this will create a localhost and link to debug so that you can run your code and make changes side by side without having to redeploy each time.这将创建一个本地主机并链接到调试,以便您可以运行代码并并排进行更改,而无需每次都重新部署。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM