Android Wear Watch:Run Debug Mode

Locus Yu
Locus Yu
Apr 13, 2018 · 2 min read

若要在Android Wear Watch專案中能夠跑在實體手表時,都必須開啟Debug Mode來進行開發時的測試。

為此紀錄一下如何開啟Android Wear Watch的Debug模式:

首先你必須在手錶上的Settings > About > Build Number的選項,並對他進行7次點擊來開啟開發者模式。

之後回到Settings頁面時,下方會多出一個Developer Options,點選此項目來進行開發模式的設定如下:

開啟ADB debuggingDebug over Bluetooth這兩個選項,接著回到手機上的開發者模式,確認USB debugging為開啟的狀態,並開啟藍芽連線。

此時可以開啟手機內的Wear OS App,點選進階設定 > 開啟透過藍牙偵錯,一開始主機所顯示的是已中斷連線的狀態。

這時,將手機透過USB連接上電腦,並分別在Command Line下執行輸入這兩個命令:

adb forward tcp:4444 localabstract:/adb-hub

adb connect localhost:4444

此時你會看到Wear OS App中透過藍牙偵錯選項的主機狀態由已中斷連線切換為已連線

最後可以看到手錶上會出現是否接受Debug模式的提示訊息,只需要點選OK即可完成Debug模式的開啟。

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store