Pritish
Pritish

Reputation: 1368

Which is the best way to install apk on Android watch while developing?

I am developing an Android Wear application. As per my understanding I must use Android Wear (mobile app) and install through it to watch. For this we need to build the apk each time and save it in mobile, and install it through the mobile app, so is there a better way to install the apk in the watch or is it the standard process?

Upvotes: 1

Views: 5091

Answers (2)

sigute
sigute

Reputation: 1201

You can install Wear apk in the exact same way as normal Android application.

First, attach Wear device to your computer and allow USB debugging. Alternatively, download and start Wear emulator through Android Studio.

Next, run your app through Android Studio - you can use run or debug modes.

That's it! :)

For distribution, the process is slightly different, depending on whether you want to support Wear 1.0 or only Wear 2.0, and whether companion app is needed on the phone. For Wear 2.0, you don't need mobile app anymore, it can be distributed directly, but of course depending on functionality you might want mobile app as well.

Upvotes: 1

mcgag
mcgag

Reputation: 355

Provided you have root privilege on your Android watch:

1.Use adb shell to connect the watch and switch to su

2.Assume your watch app is called watchapp with com.watchapp so file

chmod +777 /data
chmod 777 /data/data
chmod 777 -R /data/data/com.watchapp
#There might also be other files with suffix
chmod 777 -R /data/app-lib/com.watchapp-1

3.

#adb push your new compiled so file to overwrite that file in your watch
adb push YOURNEWSOFILEPATHONEDISK /data/app-lib/com.test-1

Upvotes: 0

Related Questions