How to create a new keystore in xamarin.android? - android

I'm trying to publish a xamarin.android app. I'm using Visual Studio with Xamarin Android 6, so I followed this. In part 2, it describes how to create a new keystore as shown in the following screenshot (You can see the complete describtion here):
I don't get where should I place this command. I looked at that keytool link, but couldn't find any thing. I tried cmd, MSBuild Command Prompt for VS2015 and Developer Command Prompt for VS2015, but all of them showed this error: '$' is not recognized as an internal or external command, operable program or batch file.
In addition to, I tried to create a new keystore using Visual Studio. I went to tools>Android>Publish Android App and I created a keystore and it appeared in path that I specified. Then I went back to that guide and continued from Sign the APK. But there's not any .apk with name and path that I specified. There are just 3 .apk that were before doing all this and don't work.
Now my question is that where should I use that command? In furthermore, I would like to know is there any other way to publish an xamarin.android app?

Reyhaneh,
Keytool is an executable provided by the Java SDK. You'll find it in your Java SDK folder, for example:
C:\Program Files (x86)\Java\jdk1.7.0_55\bin\keytool.exe
You can execute it in a normal command prompt. To create a new keystore, open a command prompt with the following line:
"C:\Program Files (x86)\Java\jdk1.7.0_55\bin\keytool.exe" -genkeypair -v -keystore <filename>.keystore -alias <key-name> -keyalg RSA -keysize 2048 -validity 10000

From my experience in generating the KeyStore and eventually publishing to google, which worked like a charm.
You first have to Archive your Xamarin.Android project by clicking on the Build menu and clicking Archive. If all works fine, this should archive the project but that's not our target. (Also please make sure the App is set to APK in the Android Package Format in the Project Properties. Just in case)
When it's complete, click on it and click the Distribute button at the bottom of the archive page.
Choose Adhoc
Click the Plus button to create the KeyStore
Fill out the form
Now, click SaveAs
Choose any place to put the APK file (we don't really care at this point)
Wait for all to be done
Go C:\Users"YOUR PC USER NAME"\AppData\Local\Xamarin\Mono for Android
You will see the KeyStore folder. Go into it to see your App folder containing your KeyStore. Please copy the entire folder and perhaps put it in your App source code folder for safekeeping or any other location of your choice.
THAT'S IT
FOR GOOGLE PLAY STORE PUBLISHING
You will need to provide the KeyStore in the Android Package Signing page in the project properties for the Android project. This is very essential as it's required before your app can be uploaded to the play store.
Next, change the Android Package Format in the Android Options tab (in the same android project properties windows) to Bundle
Now achieve the android project again by clicking the Archive button in the Build menu. This will now create the App Bundle file for Google Play Store. You can click on the Open Folder when done to get your app bundle file.
GREAT!!1
THAT IT...
Hope this helps... It's a pain at times to do all this just to get your app ready for publishing on the plat store or for other reasons.
You may get some additional information from the link below. It may be helpful as it contains some screenshots but it's not as simplified as what I have done above.
https://learn.microsoft.com/en-us/xamarin/android/deploy-test/release-prep/?tabs=windows

Related

Android Project

Guys I've used Cordova to convert a HTML/CSS/JAVASCRIPT program into an Android project but in the end I get just android-debug.apk without android-debug-unaligned.apk file.Before I make the keystore and the release version, is there any problem that I miss that file? Can I upload it by making the release version only with this file?
Update the AndroidManifest. Open /myApp/platforms/android/AndroidManifest.xml and update. VersionCode is what will display in the store; versionName is for your internal use and won't be shown: android:versionCode="10000″ android:versionName="1.0.0″ (Note on format: "10000" = 1.00.00.)
Make sure the following is accurate (change com.developerName.myApp to your own information here and throughout this page):
**package="com.developerName.myApp"**
Make sure the following is 11 or higher (I choose 19.):
**android:minSdkVersion="11"**
Open /myApp/config.xml and make sure the widget id and version are the same as in AndroidManifest.xml.
The following steps create your private key and the keystore file in which to store it. In Terminal, make sure your starting position is within your app's root folder of /myApp and run the following. (To start commands from your app root folder in Terminal, open the Terminal app, type cd and a space, drag the /myApp folder to Terminal, tap in Terminal to activate its window, then hit Enter.)
keytool -genkey -v -keystore myapp.keystore -alias myapp -keyalg RSA -keysize 2048 -validity 10000
You'll be prompted to answer several questions. Use only legal characters like letters and numbers, not punctuation. For 2-letter country code, look up this list: http://www.worldatlas.com/aatlas/ctycodes.htm
You will then review the data presented. At that point, if any of the information is wrong, type the two letters to re-enter that information. For instance, type cn to change your first and last name. Otherwise, confirm the information by typing "yes." Then just hit Enter if the password for the following Terminal information will be the same as the previous.
Your keystore file will be located at /myApp/myapp.keystore. This needs to be copied to a safe place ASAP. Your customers will not be able to update to the next version without this file.
Copy myapp.keystore to /platforms/android.
Now it's time to sign the app with the key and create the release version.
Open /platforms/android/local.properties (or project.properties) in a text editor.
Add these two lines at the end and save, even though it says, "Do not modify this file -- YOUR CHANGES WILL BE ERASED!"
key.store=myapp.keystore
key.alias=myapp
Still in your /myApp folder in Terminal, run:
cordova build android --release
You'll be asked for your password twice and it won't be obfuscated.
Your myApp.apk file is put in /myApp/platforms/android/ant-build/CordovaApp-release.apk. (If not there, it may be in /myApp/platforms/android/build/outputs/apk.) This is the file you rename and upload to Google Play

how do i find my SHA 1 for my android app in android studio?

I'm new to developing Android apps and I wanted to create a Google map inside of a Fragment. So far I've gotten the part where I need the API key and I'm confused by the instructions from the Android developer site and everything I've found online hasn't cleared my confusion.
Could someone provide me with a step by step of how to get my SHA1 fingerprint on Windows 7?
You cannot obtain the API_KEY until you get your SHA1.
Click here to get a nice tutorial that will guide you step by step with images (Specifically when you are operating on Windows 7).
Hope this would Help!!
There are two kinds of fingerprints, debug and release. Assuming you want a release one, then from a console window, you need to run this command to get the fingerprint
keytool -exportcert -alias MY_RELEASE_KEY_ALIAS -keystore MY_FULL_PATH_TO_RELEASE_KEYSTORE_FILE -list -v
The keytool program is in your JDK bin folder. So on Windows, something like C:\Program Files\Java\jdk1.8.0_20\bin is where you should find keytool
Last thing to note is that MY_FULL_PATH_TO_RELEASE_KEYSTORE_FILE in the command above should be the full path to your .keystore file, including the file name
After all that, you will be finally be provided with several fingerprints, including the SHA1. You can copy that, and go back to Google Developers Console and paste it as a new line in the allowed Android Applications, with your package name added to the end, separated by a semi-colon.

Android Signing application on Windows

I am trying to Sign up APK to upload it on to the Play Store Market. I am following the steps underlined here
I am getting the following error
When i try to Sign the Application using Eclipse project->Android Tools->Export Signed Application Package.
You don't need to do it with commands. In Eclipse, right click on your project->Android Tools->Export Signed Application Package.
Follow the wizard and you will have an signed apk without pain.
Edit:
After a quick search about the new error, this thread seems to contain possible fix for you. At instance, please try to clean your project and build it again. If it does not fix your problem, also try the fix mentioned in the link.
Copy your keystore file to a directory which has no spaces. Your current path is C:\Program Files (x86)\Java\jdk1.6.0_27\bin\my-release-key.keystore which contains the directory Program Files (x86) with spaces. JarSigner cannot identify directories with spaces.

Android sign apk file

I use this tutorial for sign my apk link
but I have stopped on the step Sign your application.
There is
./sign-mac-example.sh ../DialANumber/deploy/DialANumber.apk
Enter passphrase:
command
this not an internal or external program as I see in command line.
I use windows.
I have create all folder in workspce there are:
androidkeys (where I store my key my-release-key.keystore)
deploy (where I have export my apk file)
Thanks for help!
I can see this section a bit higher in the tutorial than the place you cite:
Write a short script to make your life easier Just to make the life
easier I wrote a short script which can be used each time to sign your
Android APK file. You can download it below and place it in the same
directory you placed the keystore at (see point 2).
Here the guy defines the script he calls with ./sign-mac-example.sh. However, regretfully this script is meat to work on linux and mac, not windows.
Nevermind the only line that is really crucial in this script is this:
jarsigner -verbose -keystore my-release-key.keystore "$1" alias_name
And you can use it in Windows also, just replace "$1" with ../DialANumber/deploy/DialANumber.apk.
I actually can not justify why the guy resorted to additional script here.
I recommend using Eclipse for signing Android Apps.
Therefore you have to install Android SDK and plugin for Eclipse. Create a project - When you're done, rghtclick on your Project and click export.
The wizard allows you to create a new keystore or use an existing one to sign your app.
I tried signing apps with console using Ubuntu, but it was hard - With Eclipse it's very easy and the export wizard creates the .apk

Android Google Maps API Key

I'm developing an app that uses Google Maps. I got the debug keystore and got the API key to work while I am debugging my program in Eclipse, but I am thoroughly confused in how to change this so that it works on an Android device when I export the .apk. I have searched around Google, but am mainly finding things that use the debug.keystore and I don't think this is what I want to use when I deploy this on an Android device, because I sent my .apk to a friend and he said he is getting gray boxes on the Map View.
Can anyone fill me in, step-by-step, on how to correctly make a new keystore for my app and how to sign my app so that it will work outside of debugging on Eclipse? A video tutorial would be preferable, but if not, simple 1-2-3 step type instructions would work. Thanks!
Eclipse (through ADT) has a nice wizard that lets you create a real keystore and build a signed apk. Right click your project, then Android Tools -> Export signed Application package
For the google maps key just follow these instructions
head to the command prompt, (I use windows so I'm going to go that route but same general idea for the other OS's)
The keytool program you'll need is part of the JDK so you do have it if your able to compile the apps at all. but it may not be on the app path so you can't just type it into the command line to be used.
for me it was in:C:\Program Files\Java\jdk1.7.0_21\bin so to get it on the app path I typed this in set PATH=%PATH%;C:\Program Files\Java\jdk1.7.0_21\bin
next you need to change to the directory your keystore files are in for me that is: C:\android\keys so I used the command cd C:\android\keys to change to the proper directory
then you need to run the keytool with the proper settings so it knows your after the key and not trying to do something else. the command I used was: keytool -list -v -keystore Testkeys and Testkeys is the name of my keystore use the name of your keystore there instead.
Last by not least it will spit out a whole bunch of different information but the one your looking for will look something like this
SHA1: A1:DF:83:DD:04:B2:26:10:B2:EB:26:00:90:75:D0:10:66:5E:A9:8A
you want all the numbers and : that are after the "SHA1: " that is your app key for the published version of your app, the one you need to register with the google maps api service, and then they will give you a new map api key that you need to put in your project and then republish it, and then the maps will work.

Categories

Resources