How can I create a keystore?

后端 未结 11 1096
北恋
北恋 2020-11-22 13:47

What are the steps to create a keystore for android?

I need to use google maps in my app and I don\'t know what steps I missed. Please provide me with the specific d

相关标签:
11条回答
  • 2020-11-22 14:21

    Create keystore file from command line :

    1. Open Command line:

      Microsoft Windows [Version 6.1.7601]
      Copyright (c) 2009 Microsoft Corporation.  All rights reserved
      
      // (if you want to store keystore file at C:/ open command line with RUN AS ADMINISTRATOR)
      
      C:\Windows\system32> keytool -genkey -v -keystore [your keystore file path]{C:/index.keystore} -alias [your_alias_name]{index} -keyalg RSA -keysize 2048 -validity 10000[in days]
      
    2. Enter > It will prompt you for password > enter password (it will be invisible)

      Enter keystore password:
      Re-enter new password:
      
    3. Enter > It will ask your detail.

      What is your first and last name?
       [Unknown]:  {AB} // [Your Name / Name of Signer] 
      What is the name of your organizational unit?
       [Unknown]:  {Self} // [Your Unit Name] 
      What is the name of your organization?
       [Unknown]:  {Self} // [Your Organization Name] 
      What is the name of your City or Locality?
       [Unknown]:  {INDORE} // [Your City Name] 
      What is the name of your State or Province?
       [Unknown]:  {MP} //[Your State] 
      What is the two-letter country code for this unit?
       [Unknown]:  91
      
    4. Enter > Enter Y

      Is CN=AB, OU=Self, O=Self, L=INDORE, ST=MP, C=91 correct?
      [no]:  Y
      
    5. Enter > Enter password again.

      Generating 2,048 bit RSA key pair and self-signed certificate    (SHA256withRSA) with a validity of 10,000 days
          for: CN=AB, OU=Self, O=Self, L=INDORE, ST=MP, C=91
      Enter key password for <index> (RETURN if same as keystore password):
      Re-enter new password:
      

    [ Storing C:/index.keystore ]

    1. And your are DONE!!!

    Export In Eclipse :

    Export your android package to .apk with your created keystore file

    1. Right click on Package you want to export and select export enter image description here

    2. Select Export Android Application > Next enter image description here

    3. Next
      enter image description here

    4. Select Use Existing Keystore > Browse .keystore file > enter password > Next

    5. Select Alias > enter password > Next

    6. Browse APK Destination > Finish

    In Android Studio:

    Create keystore [.keystore/.jks] in studio...

    1. Click Build (ALT+B) > Generate Signed APK...
      enter image description here

    2. Click Create new..(ALT+C)
      enter image description here

    3. Browse Key store path (SHIFT+ENTER) > Select Path > Enter name > OK

    4. Fill the detail about your .jks/keystore file enter image description here

    5. Next
      enter image description here

    6. Your file
      enter image description here

    7. Enter Studio Master Password (You can RESET if you don't know) > OK enter image description here

    8. Select *Destination Folder * > Build Type

      release : for publish on app store
      debug : for debugging your application
      

      Click Finish

      enter image description here

    Done !!!

    0 讨论(0)
  • 2020-11-22 14:21

    Use this command to create debug.keystore

    keytool -genkey -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
    
    0 讨论(0)
  • 2020-11-22 14:26

    Signing Your App in Android Studio

    To sign your app in release mode in Android Studio, follow these steps:

    1- On the menu bar, click Build > Generate Signed APK.


    2-On the Generate Signed APK Wizard window, click Create new to create a new keystore. If you already have a keystore, go to step 4.


    3- On the New Key Store window, provide the required information as shown in figure Your key should be valid for at least 25 years, so you can sign app updates with the same key through the lifespan of your app.

    enter image description here

    4- On the Generate Signed APK Wizard window, select a keystore, a private key, and enter the passwords for both. Then click Next.enter image description here

    5- On the next window, select a destination for the signed APK and click Finish. enter image description here

    referance

    http://developer.android.com/tools/publishing/app-signing.html

    0 讨论(0)
  • 2020-11-22 14:27

    First thing to know is wether you are in Debug or Release mode. From the developer site "There are two build modes: debug mode and release mode. You use debug mode when you are developing and testing your application. You use release mode when you want to build a release version of your application that you can distribute directly to users or publish on an application marketplace such as Google Play."

    If you are in debug mode you do the following ...
    A. Open terminal and type:

    keytool -exportcert -alias androiddebugkey -keystore path_to_debug_or_production_keystore -list -v
    

    Note: For Eclipse, the debug keystore is typically located at ~/.android/debug.keystore...

    B. when prompted for a password simply enter "android" ...

    C. If you are in Release mode follow the instructions on...

    http://developer.android.com/tools/publishing/app-signing.html <-- this link pretty much explains everything you need to know.

    0 讨论(0)
  • 2020-11-22 14:28

    You can create your keystore by exporting a signed APK. When you will try to export/build a signed APK, it will ask for a keystore.

    You can choose your existing keystore or you can easily create a new one by clicking create new keystore

    Here a link very useful and well-explained of how to create your keystore and generate a signed APK

    THis link explained how to do it with Android Studio, but if I remember, it is pretty similar on Eclipse

    WATCH OUT

    Once you generate your keystore, keep it somewhere safe because you will need it to regenerate a new signed APK.

    How do I export a project in the Android studio?

    0 讨论(0)
提交回复
热议问题