首先給到 dryrun 的 github 地址
https://github.com/cesarferreira/dryrun
一般我們在github上找到一些庫的時候宋舷,我們總會先下載下來看看是否適合我們的需求。
官網(wǎng)列出了我們通常的做法:
- Find the github's repository url
- Click the download zip
- Extract the zip file
- Open Android Studio
- Import the project you just downloaded
- Sync gradle
- Run the project
- Choose the device you want to run
- Test all you want
- Delete the project folder and the zip file when you don't want it anymore
當(dāng)然,屬性 gradle 命令的同學(xué)可以省下其中的很多步驟涤伐,但通過 dryryn 可以更加方便快捷的讓我們運行起 github 上面的 sample
首先我們需要安裝 dryrun :
$ gem install dryrun
然后就可以通過它直接運行 github 上的代碼到你的模擬器或設(shè)備了。
$ dryrun git@github.com:cesarferreira/android-helloworld.git
以后是通常的用法。
下面對使用過程中遇到的問題做些記錄:
1 運行時候下載 gradle 版本導(dǎo)致運行失敗
解決方法:
直接下載 gardle 對應(yīng)的版本到本地目錄
mac ox /用戶/hongchunhua/.gradle/dists
2 Failed to establish session
解決方法:
我用的是小米的真實設(shè)備,把小米開發(fā)者選項中最后一行MIUI優(yōu)化關(guān)掉就行