2014年2月22日 星期六

打不開 emulator 啦!!!

睡完回籠覺之後,再試著打開了 emulator ,
竟然就已經打不開了!!
出現了這樣的錯誤訊息:

emulator: ERROR: You did not specify a virtual device name, and the system
directory could not be found.

If you are an Android SDK user, please use '@<name>' or '-avd <name>'
to start a given virtual device (see -help-avd for details).

Otherwise, follow the instructions in -help-disk-images to start the emulator

查了半天,大家都說要手動設定 ANDROID_PRODUCT_OUT 這個環境變數,
但我試了之後,發現這樣對我來說還不夠,還需要設定 ANDROID_BUILD_TOP 。
越想越奇怪,我早上明明就沒有打過這兩個變數啊,也可以用,
試了一下,原來只要重新打一次

$ . build/envsetup.sh
$ lunch aosp_arm-eng

就可以同時設定這兩個環境變數,然後跑 emulator 了。

不過話說回來, lunch 是個什麼東西呢?午餐嗎?
當時看了這個說明,感覺只是要選一個 target 來 build ,
所以我以為 lunch 只是一個在 make 前要做的動作,
沒想到後來啟動 emulator 前也要做,
希望以後能知道為什麼。

沒有留言:

張貼留言