Search code examples
androidmeteorhybrid-mobile-app

meteor build app can't install on android phone


I generated a apk file by running

meteor build ~/output-dir --server=myapp.meteor.com

, then got release-unsigned.apk in the folder output-dir, it looks good.

I copy this apk file to my Android phone and tried to install it, after install guide, it shows message App not installed.

I have installed some apk files built by java on my phone before, it works, so is there something I need handle when I install apk file built by meteor?


Solution

  • As the documentation states, you can't install unsigned applications on your Android phone:

    Android requires that all apps be digitally signed with a certificate before they can be installed.

    As far as I can tell, you have the following two options to run your app:

    • Use an emulator to run your unsigned app or
    • sign your app.

    To sign your app, you can use the steps, described in the Meteor guide for submitting Android apps to the Play Store:

    1. Generate a private key using the keytool (skip this step, in case you already have a private key generated):

    keytool -genkey -alias your-app-name -keyalg RSA -keysize 2048 -validity 10000
    
    1. Sign your app using the jarsigner tool:

    jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 unaligned.apk your-app-name
    

    After that, you should be able to install and run your application on your Android phone.