Programmatically download latest version


Hey all,


Im trying to create a script to download the latest version of Intellij and do some setup to make onboarding a bit easier. However I have yet to figure out how to fetch the latest version using command line tools. The only way I have figured out how to this is using phantomJs to render the download page to get the link (using curl returns an empty href so some javascript is responsible for populating the url).

Anyway using phantomJs to get the latest link is a bit of a hack. Is there currently any better way to do this?


You can try parsing for IDEA_Release channel to get the latest version string, then construct the download link for your platform once you know the latest release version number:<VERSION>.exe<VERSION>.tar.gz<VERSION>.dmg<VERSION>-custom-jdk-bundled.dmg

Ahh!! That xml file is exactly what I was looking for!


Thank you!



Just ran into an issue with the latest critical patch where the download link is not the version number but has an 'b' appended onto the end. Is this a bug with updates.xml or how should our code handle this one off situation?


Thanks in advance.


Hi Brian,

actually updates.xml file is designed to be used by our IDEs while performing 'Check for Updates' action. 'version' attribute is used just for presentation, its value is shown in the 'Platform and Plugin Updates' dialog. So it isn't guarantied that this value directly corresponds to the download URLs. 2016.1.2b was a hotfix update and we didn't want to change version name for it. For now you can either add an exception for 2016.1.2 or wait for 2016.1.3 which will be released very soon.

Unfortunately currently there is no reliable way to get the latest version of the IDE programmatically. The URLs provided by Serge aren't quite correct, we started bundling our custom JDK by default with Mac OS X distribution, so there are no '-custom-jdk-bundled.dmg' artifact anymore. Though we plan to fix this problem by providing a reliable way to get download URLs for different versions.


I'd also like to prgrammatically determine the latest version of IDEA, but the linked updates.xml does not seem to contain updates for IDEA anymore. Is that somewhere else now?


It does:

<channel id="IDEA_Release" name="IntelliJ IDEA Release" status="release" url="" feedback="" majorVersion="2018" licensing="release">
<build number="181.5540" version="2018.1.6" releaseDate="20180327" fullNumber="181.5540.7"> will download the latest IntelliJ IDEA Ultimate for Windows.

oh indeed - why is the order so incredibly random though?

To figure out the latest version of IDEA I apparently have to fetch all versions and then compare them to find the greatest one. oof.

EDIT: This looks a lot better:


Just for future reference. This is the script I use to get me the latest version and return the file to download.


   local extension=".tar.gz"
   if [ $(uname) = Darwin ]; then
   #To get the latest version we scan through the updates.xml to find the current release version.
   local builds=$(curl -s |\
                  xmllint --xpath "//product[@name='IntelliJ IDEA']/channel[@id='IDEA_Release']" - )
   local latestNumber=$(echo $builds | xmllint --xpath "//build/@number" - |\
                        sed 's/number=\"\([[:digit:]]*\.[[:digit:]]*\)\"/\1/g' | tr " " "\n" | sort -bnr | head -1)
   local latestVersion=$(echo $builds | xmllint --xpath "string(//build[@number=$latestNumber]/@version)" -)

This at has been working for me for the past few years. Hopefully it can help someone else.


I use a curl one-liner to update PhpStorm on Ubuntu ;)

sudo curl -L "" | sudo tar xvz -C /opt/phpstorm --strip 1 && /opt/phpstorm/bin/



Philipp ‘s answer is very useful to me. However, how do you specify the arch in that url? For example, I’d like to download a linux aarch64 tar ball. 


Jacky Liu Thanks for your comment. Is there a list of valid values for the variable `platform`?



Available options are:



Please sign in to leave a comment.