React Native Android Debug Keystore - android

Question about generating API Keys for Android in React Native.
I'm referencing these:
https://developers.google.com/maps/documentation/android-api/signup#release-cert
https://facebook.github.io/react-native/docs/signed-apk-android.html
https://github.com/lelandrichardson/react-native-maps/blob/master/docs/installation.md
What I'm wondering is, is how do I setup a debug API key for android if I'm NOT running on an emulator? I know I can use this command
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
if I want to create a debug.keystore that the emulator can look at, but how does this work for when I want to compile, build an apk, and run on my device? Do I have to set a pointer to it in gradle.properties? Does React Native know to look in that folder for the debug.keystore, and incorporate it into the apk? I'm not really sure how these things work.

cd android/app/
run:
keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000

Well turns out i just needed to rerun react-native run-android, didn't get my latest change in.
From the looks of it, by default android's settings will look at ~/.android for the debug keystore.

Related

Android: Released vs Debug Fingerprint (Sha1)

I was trying to obtain my Sha1 fingerprint for release and debug. Fortunately, I was able to obtain the debug version code through
keytool -list -alias androiddebugkey -keystore C:\Users\Name.android\debug.keystore -storepass android -keypass android
I was wondering how I would get the release? I tried
keytool -list -alias androidreleasekey -keystore C:\Users\Name.android\debug.keystore -storepass android -keypass android
but unfortunately it came out as keytool error: java.lang.Exception: Alias <androidreleasekey> does not exist.
*Actually my result may have been my released key store since I already built it as released app... I'm not entirely sure though.
You need to find the location of the release keystore file and the name of the alias that you used to build your app.
To do this in Android Studio select Build > Generate Signed APK. You should see a dialog similar to below.
Get the location of the full file path for the release keystore from the Key store path. Then use this path along with the Key alias that is listed to get the SHA1 as you tried previously:
keytool -list -alias myappsalias -keystore
C:\users\dell-laptop\AndroidStudioProjects\myapp\myapp_release.keystore -storepass android -keypass android

How to find SHA1 in Cordova project

So... I need to get a SHA1 key. I'm not a Java fan, so I'm creating my app in Cordova but I need the SHA1 to register it in Google's Developer Console. Does someone know where it is? I tried importing the project in Android studio but still couldn't find anything...
For Windows you have to create it using command prompt.First go to your java bin directory via the cmd like C:\Program Files\Java\jdk1.7.0_71\bin,then type
keytool -list -v -keystore c:\users\your_user_name\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
For Mac users go to terminal ,then type
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

There is no debug.keystore in .android folder

Someone I'm helping with an application needs to locate her debug.keystore - mine is in my .android folder, but when I navigate there on her computer it is not there.
Does something need to be done in order for it to appear? Where is it / how can it be generated again?
According to the documentation, performing a build in Eclipse or using ant debug should automatically generate ~/.android/debug.keystore.
But in case this doesn't work, you can create one manually by running:
keytool -genkey -v -keystore ~/.android/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"
If she is using Eclipse then go to Windows -> Preferences
Select Android -> Build
There you will see Default debug keystore: "Path"
See if you can locate it there.
You can create keystore using this command..
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"
The debug.keystore is created automatically on first build that uses it.
On Windows 7, I had to create the file manually using John's suggested command. Don't forget to enclose the path in a pair of double quotes (").
I don't know how it work magically!
I deleted my debug.keystore, build my project again and look for debug.keystore in default location ~/.android/debug.keystore, din't find debug.keystore.
Again build project and look for debug.keystore, no luck!
Then I open eclipse go to Windows -> Preferences,Select Android -> Build
See Default debug keystore: "Path".
Now again looked for debug.keystore in default location ~/.android/debug.keystore, found debug.keystore.
Tried so many times, it worked.
try this....it will generate the file debug.keystore to
C:/
for all versions of Windows
keytool -genkey -v -keystore C:/debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 999999 -dname "CN=Android Debug,O=Android,C=US"
Try this for Generating PKCS keys.
keytool -importkeystore -srckeystore C:\Users\xxx\.android\debug.keystore -destkeystore C:\Users\xxx\.android\debug.keystore -deststoretype pkcs12
Note: RSA2048 is not a recommended industry standard and the above command can be used to migrate the existing debug.keystore in RSA2048 to PKCS format
The old debug.keystore which was in RSA2048 will be renamed to debug.keystore.old and saved automatically
To get the key you should first run the app on a device(real device or emulator). While debugging the file is automatically created.
debug.keystore automatically generate after the run of the app debugging

Error in Keytool command

hi when i try to run this command bin/keytool -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android
i got the error java.lang.Exception Keystore file doesnot exist :debug.keyStore
actually i am trying to get googlemaps key for android never used keytool command.
can any one help how to remove this error
The problem is that the keytool does not know where to look for the keystore file.
If you're on Windows 7 / Vista, try:
keytool -list -alias androiddebugkey -keystore c:\users\your-user-name\.android\debug.keystore -storepass android -keypass android
(replace your-user-name with your actual user name)
For Windows XP, try:
keytool -list -alias androiddebugkey -keystore c:\documents and settings\your-user-name\.android\debug.keystore -storepass android -keypass android
If V2 map to generate SHA key use this command. use for releasing key means for testing.
C:\Program Files\Java\jdk1.6.0_20\bin>keytool.exe -list -v -alias androiddebugkey -keystore C:\Users\DON\.android\debug.keystore -storepass android -keypass android
Don is usersystem name
If you want app live means for development.
eclipse->Window ->Preferences ->Android ->Build -> now you get the sha key
Finally i solve the problem and the correct working script / Command is below:
Please note the double quotes where they are placed please use as it is as this is the correct method. and off course please change the user name and as for the different versions of windows you people will have to change it accordingly. Please feel free to ask if you people have any questions.
C:\Program Files\Java\jdk1.6.0_25\bin>keytool -list -alias androiddebugkey -keys
tore "c:\documents and settings\user\.android\debug.keystore" -storepass android
-keypass android

Googlemaps API: problems getting my key

i am doing a debug key and i can't. Im stuck here:
"Once you have located the keystore, use this Keytool command to get the MD5 fingerprint of the debug certificate:
$ keytool -list -alias androiddebugkey \
-keystore .keystore \
-storepass android -keypass android"
i located my keystore, but i dont know how to put that order.... i think that order is for linux, and i am using windows XP Professional
can someone help me plz?
Get rid of the backslashes. Those, in Linux and OS X, denote line continuations.
So, in Windows, if you are in the directory containing your debug keystore, you should be able to run:
keytool -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android

Categories

Resources