Android Studio 更新


Android Studio是今年5月份Google I/O 2013開發者大會上Google為Android開發者發布的一項全新的基於IntelliJ IDEA的Android開發環境。

官方網址:http://developer.android.com/sdk/installing/studio.html 。

目前(2013-09-25)發布的完整安裝包版本為:130.737825,可通過patch補丁升級到版本:0.2.9(132.830170)。更新信息可查看:Recent Changes 以及:https://dl.google.com/android/studio/patches/updates.xml 。

可以在官網網址下載Google發布的最新完整安裝包,然后通過菜單:Help -> Check for Update 來更新Android Studio。但是遺憾的是由於Android Studio的更新網址dl-sdk.appspot.com被封鎖,所以你很可能看到如下界面:

常規途徑被封鎖,因此需要通過其他方法來升級。

我們可以使用VPN或者一些代理軟件來更新Android Studio。我選擇GoAgent代理軟件來升級。安裝配置完GoAgent,啟動,顯示如下:

然后在Android Studio中,選擇 Files -> Settings -> HTTP Proxy -> Use proxy -> HTTP, 然后在Host name中輸入:127.0.0.1,在Port number中輸入:8087。選擇 Ok,代理就設置完成了。然后再Check Update,依然失敗。

Google到如下解決方法:https://code.google.com/p/android/issues/detail?id=56068#c3 。

1- If you can access the appspot URL via a browser, you should be able to do it via Studio directly by using File>Settings>HTTP Proxy. Configure your socks proxy there and use the "check connection" once, then try Help>Check for updates.

2- If the issue is with the appspot redirector, you can bypass it by setting an environment variable before invoking studio from the command line:

$ export REQUIRED_JVM_ARGS="-Didea.updates.url=http://dl.google.com/android/studio/patches/updates.xml -Didea.patches.url=http://dl.google.com/android/studio/patches/"
$ bin/studio

Once you start Studio, do step 1: go to file>settings>http proxy, set your socks proxy, check the connection, then use help>check for updates.

3- If that still fails, you can download the patch and apply it manually.
The patch is located at
http://dl.google.com/android/studio/patches/AI-130.687321-130.692269-patch-unix.jar
(syntax is "AI-$FROM-$TO-patch-unix.jar", where you get the from/to using the updates.xml file)
Once you have that file:
$ cd android-studio-directory
$ java -classpath /path/to/AI-130.687321-130.692269-patch-unix.jar  com.intellij.updater.Runner install $PWD

 

1.如果你可以使用瀏覽器訪問網址dl-sdk.appspot.com,那么你可以通過File>Settings>HTTP Proxy來配置代理,然后通過Help>Check for updates嘗試更   新。
2.如果appspot網址被重定向,你可以設置環境變量,然后使用代理(我使用的是ubuntu):
$ export REQUIRED_JVM_ARGS="-Didea.updates.url=http://dl.google.com/android/studio/patches/updates.xml -Didea.patches.url=http://dl.google.com/android/studio/patches/"
$ cd android-studio
$ bin/studio.sh
然后在android studio 中使用步驟1的操作來更新。
也可以將 export REQUIRED_JVM_ARGS="-Didea.updates.url=http://dl.google.com/android/studio/patches/updates.xml -Didea.patches.url=http://dl.google.com/android/studio/patches/" 加入到bin/studio.sh腳本文件中ALL_JVM_ARGS的賦值之前,這樣直接執行studio.sh腳本即可
3.如果更新仍然失敗,可以手動下載更新補丁patch,patch通過一下網址下載:
http://dl.google.com/android/studio/patches/AI-130.737825-132.830170-patch-unix.jar ,其命名規則為:
 linux: AI-$FROM-$TO-patch-unix.jar
  windows: AI-$FROM-$TO-patch-win.jar
  MacOS: AI-$FROM-$TO-patch-mac.jar
  其中的兩個版本號,前一個FROM是你當前版本號,后一個TO是升級到的版本號。
下載文件到本地后,放到Android Studio程序根目錄:
$ cd android-studio
$ java -classpath AI-130.737825-132.830170-patch-win.jar com.intellij.updater.Runner install .

 我使用步驟2配合GoAgent更新成功。Windows下使用GoAgent沒有成功,貌似是GoAgent的證書的問題。可以使用步驟3,直接下載patch更新。

 寫了個更新的腳本,python寫的,支持Linux,Windows,MacOS操作系統。因為沒研究過python,代碼都是用到什么就google出來函數拼湊的,有需要的自己下載下來修改。

https://github.com/daemon369/Demo/tree/master/20130830

參考:

https://code.google.com/p/android/issues/detail?id=56068#c3


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM