Setting up Android Wear Development Environment and Debugging

At the latest version of Android Studio, setting up development environment for android wear is pretty easy.You just select your target as Wear and you’re good to go.

At the second step Android Studio asks you about what you want to develop for Android Wear.Select your project type like shown below:

For example mine was a Watch Face.

Screen Shot 2015-10-15 at 10.28.42 Than Android Studio creates your project.

If you don’t have a smartwatch you can develop on emulators provided by the Android Studio. From AVD Manager , create an Android Wear emulator.

If you have a smart watch this is the place where the struggle begins. Because some watches don’t have a usb port so you have to debug it over your phone.To be able to debug,first you should unlock developer options on android wear device(I assume that you unlocked developer option on your Android Phone).What you should do is :developer options view

Open “settings”>”about” tap “Build number” several times and developer options will be opened in the settings.

In Developer options make sure that you enabled “ADB debugging” and “Debug over Bluetooth”.

Your job with the smartwatch is over. Next , you also have to enable debugging over bluetooth from your Android phone.In settings section at the bottom you’ll see “Debugging over Bluetooth”.debugging over bluetoothWhen you enabled it there is a status info about target and its host.Host status is “disconnected” as you see at the left image. To connect host, you have to open terminal and type :

After that status will be like this :

connected

From now on you can debug your apps on your Android Wear smartwatch.But its quite disturbing to debug it on real device.It takes some time to upload so I realised that using a virtual device is more practical.

Sources: https://developer.android.com/training/wearables/apps/bt-debugging.html

Leave a Reply

Your email address will not be published. Required fields are marked *