背景
在感受了Genymotion的流暢性之后,我已經(jīng)決定使用Genymotion來進(jìn)行Android開發(fā)。但是在使用Genymotion打開虛擬機(jī)之后,run卻找不到虛擬機(jī)剩彬。
因為這個問題,每次我都要通過關(guān)閉Android Studio和Genymotion矿卑,連上我的真機(jī)喉恋,然后啟動Android Studio和Genymotion,才能正常使用母廷。
今天轻黑,我終于發(fā)現(xiàn)了問題的原因所在,居然是因為ADB客戶端和服務(wù)端的版本不一致琴昆。
在命令行下執(zhí)行 adb get-state 可看到原因氓鄙。
cyy@cyy-pc:~$ adb get-state
adb server version (36) doesn't match this client (39); killing...
error: could not installsmartsocketlistener: Address already in use
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon
adb server version (36) doesn't match this client (39)的意思就是adb服務(wù)器版本不能匹配該客戶端。因為Android Studio使用的adb和Genymotion使用的adb版本不一致业舍。
好了抖拦,原因找到了。那么解決方法呢舷暮?
1态罪、打開Genymotion->Settings->ADB
2、選擇Use custom Android SDk tools
3下面、設(shè)置Android SDK的路徑
4向臀、關(guān)閉,重啟Genymotion虛擬機(jī)
搞定诸狭,在次執(zhí)行adb get-state
cyy@cyy-pc:~$ adb get-state
device
再run時就能看到虛擬機(jī)了o(^_^)o券膀。