Automatically upload ProGuard mapping files to play console - android-studio

Is pretty annoying to upload the ProGuard mapping files to google play console everytime i need to build a new version of my apk (my gradle build generate 4 different apks for every release so i do need to upload 4 different mapping files)
I was wondering if is possible to make this process automatically then i found this article
https://developers.google.com/android-publisher/api-ref/edits/deobfuscationfiles/upload
So google does have an api to upload the mapping files, is there any gradle plugin to work with? is there any easy way to integrate?

Suggestion: If you publish an Android App Bundle instead of APKs, the deobfuscation mapping file will be uploaded automatically with your artifact so you don't have to do it separately.
For the curious, the mapping file is located at BUNDLE-METADATA/com.android.tools.build.obfuscation/proguard.map in AAB (which is, like the APK format, just a ZIP file).

you can write a gradle build script to run tasks after build complees
and then you can use something like this file upload plugin to upload the file to the url

when you have Crashlytics set up, this is being explained here. there's also a Play Publisher Plugin for Gradle, while it does no seem to upload the mapping.txt. if you want to use that API, it should be easy to extend eg. the Google Cloud PHP Client with another API endpoint.

Related

How do you make Android Studio automatically include the proguard mapping file in a signed bundle?

I recently switched to uploading bundles instead of .apk files to Google Play. I'd like to include the mapping.txt file in the bundle automatically so I don't have to keep uploading them separately every time. It appears that this can be done automatically (search this page for "ProGuard") but I couldn't find instructions.
The process is indeed automaticallly done, you do not need to upload the mapping file separately.
AndroidStudio puts the mapping file in your bundle's BUNDLE-METADATA/com.android.tools.obfuscation folder. After generating the bundle there should be a proguard.map file inside.

How to properly create Android/iOS Expansion Files

Is there a proper way to create expansions files for iOS and Android apps using the command line tool (haxe or lime) or is it always just by manually making a .zip file and renaming it to match the correct pattern?
I do the same thing. I also made an extension with a tool for this that simplifies the command. In addition to zipping and pushing the obb file to your device for testing, it also has the suggested google libraries to handle downloading the OBB in the case that the APK is downloaded and not the obb. https://github.com/thomasuster/android-expansion

How to add a lot of resource files to a monotouch project?

I have a lot of png images into a directory. I've added it to the project as Content/Copy if newer. I can load them from the app without problems.
But, the project needs a lot of time to compile. If i make a little change in the code, the project recompiles all again. It takes a lot of time.
I've tried to add another project, add the files to the new project, but then i can not access to the files from the app.
Is there any solution?
Of course, when i debug the app into the iPad, the uploading+install takes a lot of time. These files will not change ever, so...Is there any method to copy all the content ONE time?
Thanks
I just have discovered a tricks. It seems that monotouch does not remove directories when you upload and install from the MonoDevelop environtment, so:
Add your folders and all the files and mark them as Content
Build your project for iPhone/iPad and Run it from MonoDevelop
Remove your data foldres from your porject
Clean the solution
Make any changes you need in your code, your data reamins in the device!!!
That changes all!!! Before that, when i need to make a minor change in my code, i needed to wait about 15' for building and uploading. Now it's just 1 minute!!!
Place your images in a separate class library
Mark all your files as embedded resources
Add a logical name to each resource (in your project file)
<EmbeddedResource Include="Images\Folder\Filename.ext">
<LogicalName>LogicalNameForImage</LogicalName>
</EmbeddedResource>
4. Load the resource as
UIImage.FromResource(yourAssembly, "LogicalNameForImage");
Embedded resources are loaded on demand, not when the assembly loads.
In A future version of MonoDevelop (my patch didn't make it in time for the upcoming 4.0 release), this won't be an issue any longer.
What currently happens in MonoDevelop 3.x is that when building a project, it will only copy the images that have changed into the app bundle, however, after building, MonoDevelop invokes a script that is installed along with Xcode called iphone-optimize which scans the entire app directory and uses pngcrush to crush all of the images (it also converts all plist files into binary plists). This is the step that causes such slow build times if you have a lot of images.
Just after the 4.0 branch closed for QAing, I wrote a patch that avoids the need for invoking the iphone-optimize script. Instead, what MonoDevelop will do is it will directly invoke pngcrush on only the images that have changed, passing the proper app directory location as the output argument to pngcrush so that we avoid an additional file-copy.
From my own testing, this makes a massive improvement to build times for projects with a lot of image files.
In the meantime, what you could do, is make a backup of the iphone-optimize script (should be located somewhere under /Applications/Xcode.app) and then modify it to not crush image files. Then, once you've done that, go and pre-crush all of your png files in your project.
(Note: when the MonoDevelop with my patch finally ships, it'll also have an option to disable calling pngcrush for developers who have already pre-crushed their images).

Distribute MonoTouch app to testers using Organizer?

I am trying to archive my MonoTouch app and to supply it to our testers using Apple's/Xcode's organizer.
Can somebody tell me how to do that? In ObjC projects I can archive an application. But how can I achieve the same in MT/MonoDevelop?
My starting point was this documentation:
http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iphone_development/145-Distributing_Applications/distributing_applications.html
René
The archive that Xcode provides is in the form of an .ipa file. This is a glorified zip file with a certain expected file structure.
The .ipa is made up of the following components:
A folder named "Payload", which contains the compiled
(release/iPhone) .app
a 57x57 .png icon file (which is displayed while the app is being
downloaded)
a 512x512 .png file of the icon once again - however this has to
renamed itunesartwork with no extension
iTunesMetadata.plist - this contains information about the app,
such as copyright name, genre, itemname, softwareIconNeedsShine (you
can google what information this needs).
The way I package up our .ipa, is I have a folder called "App Packaging" which has all of these components already in, and I simply update the .app file whenever we do an upload, "Compress..." then rename the file to x.ipa (OS X will ask if you want to use this extension, make sure you select ("use .ipa" !).
You can then send the file to the testers to install via itunes. If the testers are all testing on devices that are iOS 4.0+ then it is possible to distribute this over the air as well but I can go into that only if you would like me to?
EDIT - Over the air distribution
It is possible to do over the air distribution of apps as well. We use it for distribution of an enterprise app we develop but it is possible to use it for testing purposes as well. It should be noted here that in order for the app to installed, the device needs to be included in the provisioning profile you signed the app with (but you knew that already!).
In order to do over the air, you need 3 things:
the .ipa file we created earlier.
a 57x57 .png icon file (same as the one included in the .ipa preferably)
a file called "Manifest.plist"
The Manifest plist contains the following structure/information:
You'll then want to upload all of these files to your website/intranet etc. In order to download the app, you'll need to create a page that points to the Manifest.plist file and then then iOS takes care of the rest and downloads the app from the location specified in the manifest.
There is now a much much easier way. On the Project menu in MonoDevelop, choose Publish to TestFlight.
You'll need a free TestFlightApp.com account, but it works great!

File format for submitting iPhone app in App Store

When I am building my app,Xcode generates it in .app format. Usually when I install app from AppStore they are in .ipa format. How does this format get generated? Will it be done by guys at AppStore while reviewing app or what? In which format should I compress my .app file?
Thanks
An .ipa file is simply a zipped archive of a .app bundle. Previously, you would simply zip up the compiled application bundle (by right-clicking on it and choosing Compress "xxx.app") before submission, but newer versions of Xcode now do this for you with their Build and Archive or Archive options.
In fact, you might be able to learn things by unzipping other application .ipa files you get via the App Store and inspecting their contents (like Info.plist settings or bundled resources). I know I have.

Resources