eclipse 打包 apk 文件

1.通过eclipse中的file ,点击Import 导入项目

2.选择Android 中的 Existing Android Code Into Workspace

3.通过 Brower 引入项目

4.勾选 platforms\android 和 platforms\android\CordovaLib

5.通过file ,点击 Export 开始打包

6.选择Android 中的 Export Android Application

7.通过 Browser 选择打包的项目 (MainActivity)

8.选择或设置 keystore 选择保存地址 并 设置密码

9.设置 Aliaas , Password , Confirm , Validity(years) 25年 ,First and Last Name

10.设置储存位置 设置文件名


遇到的坑:

1.no emulator images (avds) found 找不到模拟器镜像

重新设置 window - Android Virtual Devices (AVD) Manager

2.设置apk 的 桌面图标

修改名称 项目名 -- res -- value -- string.xml -- 修改app_name

修改图标 configure launcher icon

首先,在Eclipse中某个android项目上右击打开 New - Other 视图,

打开Android 文件夹,其中有一个 Android Icon Set 选项,

点击Foreground 中的 Image 按钮 ,选择图片 ,点击Finish

修改 项目名称 下的 AndroidManifest.xml中 android:icon

android:icon="@drawable/ic_launcher" //ic_launcher这个图标改下就可以改图标

3.设置 apk 的 启动画面

打开 src 文件夹 打开文件 SplashScreen.java

查询 onDestroy()

firstShow = true;

注:默认是被注释掉的,表示只是第一次启动时才显示启动画面,我们只需取消注释后再重新编译后,每次启动都会有启动画面了

使用 cordvoa 插件 修改启动页 图片 ==》 cordova plugin add cordova-plugin-splashscreen


注:重置 eclipse ===>> Window-->Perspective-->Reset Perspective

或 清除根目录下的项目文件(简单粗暴)

4.热更新(在线更新)

5.注:1.复制 根路径 下的splash文件 及 icon 文件,并粘贴 到 platforms -- android -- res 中(替换)

2.gulp 压缩js 文件 删除多余文件,修改index.html 上的路径 及 platforms -- android -- assets --

www 下的对应配置

3.eclipse 修改图标(@drawable/ic_launcher)

new -- other -- AndroidManifest.xml -- android:icon -- @drawable/ic_launcher

原文地址:https://www.cnblogs.com/crazycode2/p/6260508.html