Download IPA / APK from Crashlytics

24,220

Solution 1

After poking around myself, it doesn't look like there is any way to pull an ipa or apk from Crashlytics Beta.

I would suggest using something like Jenkins or Fastlane to automate your build process and have it a) upload to Dropbox or somewhere you can easily refer to and b) upload automatically to Crashlytics for distribution.

The gradle crashlytics plugin provides a handy method to do this:

gradlew assembleDebug crashlyticsUploadDistributionDebug

Solution 2

If you're using it with iOS, you can enable Settings > Safari > Advanced > Web Console, then look in the web inspector of the download link from the install page on iOS. It will look like this (I swapped in gobbledegook text for some parts):

<a class="primary-button js-install-button" href="itms-services://?action=download-manifest&amp;url=https%3A%2F%2Fapps.crashlytics.com%2Fprojects%2F2F2F2F2F2FF2F2F2%2Freleases%2F2200806%2Fdownload.plist%3Fdevice_id%2F2F2F2F%26device_token%234JH23L4KH234LK2J34H2LK34H2LK3J4H2LK3JH42L3K4JH23LK4JH2L3K4JH2L3K4JH2LKJ3H4%253D--2KJ3H4LK2J3H4L2KJ3H4LK2J3H4LK23JH4LK2J3H4L%26payload_token%2KL34JH2LK3JH4L2K3J4HL23KJ4HL23JK4" id="most-recent-install">Install</a> 

Then just copy out the URL-encoded URL:

https%3A%2F%2Fapps.crashlytics.com%2Fprojects%2F2F2F2F2F2FF2F2F2%2Freleases%2F2200806%2Fdownload.plist%3Fdevice_id%2F2F2F2F%26device_token%234JH23L4KH234LK2J34H2LK34H2LK3J4H2LK3JH42L3K4JH23LK4JH2L3K4JH2L3K4JH2LKJ3H4%253D--2KJ3H4LK2J3H4L2KJ3H4LK2J3H4LK23JH4LK2J3H4L%26payload_token%2KL34JH2LK3JH4L2K3J4HL23KJ4HL23JK4

Then urldecode that on your command line using PHP:

php -r "echo urldecode('{PASTE THE ABOVE URL HERE}');"

(Make sure that you use double quotes around the PHP line, and single quotes around the URL.)

Then paste the URL-decoded result into Safari on your Mac. You'll see an XML file; copy the download link and paste into your browser. This will download the IPA to your Mac :D

Solution 3

As far as I can see there is no straight forward way to download an IPA from Crashlytics. However, if you really need to get the file it can be done.

  • Copy the link target of the Install button in the Crashlytics mail (alternatively view source and copy from there, this is what I did)
  • Paste to Safari in the Simulator. This will install the Crashlytics app in the simulator
  • Open install page in the Crashlytics app in simulator
  • inspect simulator with your Macs Safari (Develop > Simulator)
  • Copy button link and open in Safari on Mac - there you go

Of course this is nothing you want to do as a standard procedure :)
And sorry this is iOS only, so no bounty for me :(

Solution 4

I found an easy way to get APK builds on Android. Follow these steps:

  1. Install "Amaze File Manager" on your device. Free version is enough and it doesn't need your device to be rooted.
  2. Open "App Manager" in the menu on the left
  3. Find your installed build by its name
  4. Press "three dots" and select "backup"
  5. You will find your APK file in the storage/emulated/0/app_backup

Solution 5

This answer is probably too late, and is only specific to the APK file, but I did manage to identify where Crashlytics stores the APK before installation.

After installing Beta/Crashlytics on your device, go ahead and download your application, but don't install it - just leave it at the screen asking if you want to install (just in case Beta/Crashlytics deletes the APK after installation, not sure if they do though)

Then, using adb via another computer, identify the file name of your application by opening up a shell and finding all APK files.

  1. Open command prompt or terminal, and run adb devices to ensure your device is recognized
  2. Once recognized, run adb shell, and then type su to enter superuser mode
  3. There are 2 ways - you can search for all APK files and look for a file name similar to what you would expect using "find / -iname *.apk" OR you can try listing the files sorted by modified date to look for a recently modified APK using the following command "ls -nl [directory] | sort -k 8,8n -k 6,6M" where [directory] is the directory you want to list
  4. Note the location, and then exit adb, and grab the file using adb pull - in my case it was "adb pull /data/app/myapplication.apk"

TL;DR - Beta/Crashlytics downloads the APK file for your application to /data/app/ before installing. You may need root privileges to access this folder.

Hope this helps!

Share:
24,220

Related videos on Youtube

dogsgod
Author by

dogsgod

Updated on June 23, 2020

Comments

  • dogsgod
    dogsgod almost 4 years

    I'm using Crashlytics to distribute an app for Beta testing.

    While it is easy and convenient to install the app on devices from the Crashlytics app, I have not been able to figure out how I could download only the IPA from the Crashlytics server.

    Background: I need to get the IPA / APK for automated testing. My test environment will re-sign the IPA to be able to install it to test devices, so going the Crashlytics app way doesn't work.

    What I need would be a download link for the IPA / APK as it used to be available in TestFlight or Hockeyapp.

    • dogsgod
      dogsgod about 9 years
      Hi Nachi, thanks for supporting my cause with Android power :)
    • CommaToast
      CommaToast over 8 years
      Check out my answer, I have now provided you with a way to do what you asked for.
    • dogsgod
      dogsgod over 8 years
      @CommaToast check out my upvote I gave you yesterday. You might also want to check my own answer that provides a similar way ...
    • Saif Siddiqui
      Saif Siddiqui almost 5 years
      This question seems to be interesting, is this still valid: can we use IPA/APK from Crashlytics file to use it as an automation build?
  • dogsgod
    dogsgod about 9 years
    That's not the question, that's the obvious use case. What I (and some others) are looking for is a direct download link for the app. As described, I do not want to install the file.
  • Mehul Thakkar
    Mehul Thakkar about 9 years
    oh sorry, misunderstood, They are not providing direct link for download, Yes you can forward your mail to other users, anyone can download from that. If you are really interested in getting link such a way than i can say that follow the steps as described by Razvan on link stackoverflow.com/questions/26042508/… for OTA distribution, and for creating ipa automatically use jenkins or make simple commanline script to create ipa file, and just hit that one in terminal
  • Mehul Thakkar
    Mehul Thakkar about 9 years
    Application named Buildshake is currently under development which is going to be used for the same(from ngeleousera.com)
  • dogsgod
    dogsgod about 9 years
    Thanks, But that's not what I'm asking for. I also know other Beta distribution platforms that offer what I need. But I want to know how this can be done with Crashlytics!
  • Mehul Thakkar
    Mehul Thakkar about 9 years
    No, they are not allowing that, actually they are installing it via there own application that is getting installed on your device first.
  • Nachi
    Nachi about 9 years
    Although not a direct answer, this is the most viable approach because it is cross-platform and easy to do if you are already building your artifact using a CI server.
  • Manoj Soundarrajan
    Manoj Soundarrajan about 7 years
    Not able to open data/data/io.crash.air/files. It is just showing one data folder.Not able to go inside that folder
  • w3bshark
    w3bshark about 7 years
    @ManojSoundarrajan Do you have access to that filepath? Maybe try running this on an emulator?