从真实设备卸载 Android Wear 应用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24687375/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Uninstall Android Wear App From Real Device
提问by KevinTydlacka
Might be a noob question but for the life of me I can't figure out how to uninstall an app from my Samsung Gear Live.
可能是一个菜鸟问题,但对于我的生活,我无法弄清楚如何从我的 Samsung Gear Live 卸载应用程序。
I need to uninstall the debug version so I know I have a fresh production version when I download it from the Google Play store.
我需要卸载调试版本,所以当我从 Google Play 商店下载它时,我知道我有一个新的生产版本。
回答by matiash
I don't know if there is a user interface for this. The easiest way I've found is via adb:
我不知道是否有用于此的用户界面。我发现的最简单的方法是通过 adb:
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
So, for example:
因此,例如:
adb uninstall com.example.testandroidwear
As both @WaynePiekarski and @Thoast83 have mentioned, if the Android Wear device is connected via Bluetooth instead of a direct USB connection (e.g. when testing with the Moto 360) then you need to use adb -s <device> <command>
as instructed by Directing Commands to a Specific Emulator/Device Instancein the adb documentation.
作为@WaynePiekarski和@ Thoast83都已经提到的,如果Android Wear设备通过蓝牙连接,而不是直接的USB连接(例如与摩托车360进行测试时),那么你需要使用adb -s <device> <command>
的指示,由导演指令到特定的模拟器/设备实例中ADB文档。
In this case, it might be something like:
在这种情况下,它可能类似于:
adb -s localhost:4444 uninstall com.example.testandroidwear
provided you have established the connection exactly as described in Debugging over Bluetooth(otherwise, adjust the port number accordingly).
如果您完全按照蓝牙调试中的描述建立了连接(否则,相应地调整端口号)。
回答by Thoast83
In case anyone is debugging via bluetooth and stumbles upon this thread, write:
如果有人通过蓝牙进行调试并偶然发现此线程,请编写:
adb -s localhost:4444 uninstall example.com.yourappname
回答by Wayne Piekarski
When you install an APK via the Play Store or via adb to the phone, the embedded wearable APK is automatically installed to the wearable.
当您通过 Play 商店或通过 adb 将 APK 安装到手机时,嵌入式可穿戴 APK 会自动安装到可穿戴设备。
If you are developing and want to play around with things, or if you are doing debug builds which do not do the embedded APK, you will need to use adb uninstall to both the phone and the wearable.
如果您正在开发并想尝试一些东西,或者如果您正在进行不执行嵌入式 APK 的调试构建,您将需要对手机和可穿戴设备使用 adb uninstall。
You can use adb devices to discover the names of the connected devices, and then adb -s followed by the name of the device. You use the internal package name with the uninstall command.
您可以使用 adb devices 来发现连接设备的名称,然后使用 adb -s 后跟设备名称。您可以在卸载命令中使用内部包名称。
回答by Lee Hounshell
First use 'adb devices' to find all connected devices:
首先使用“adb devices”查找所有连接的设备:
$ C:\Program Files (x86)\Google\Cloud SDK>adb devices
List of devices attached
603KPSL029398 device
5c9cc2e0 device
Then run uninstall for app using adb on the desired device:
然后在所需设备上使用 adb 运行卸载应用程序:
$ C:\Program Files (x86)\Google\Cloud SDK>adb -s 603KPSL029398 uninstall com.example.android.support.wearable.notifications
Success
回答by Vyacheslav
I would suggest to use 127.0.0.1
instead of localhost
我建议使用127.0.0.1
而不是localhost
adb -s 127.0.0.1:4444 uninstall example.com.yourappname
adb -s 127.0.0.1:4444 uninstall example.com.yourappname
回答by Eli
Even after uninstall, my watch (moto360 second gen, running android wear 1.5.03336103, Android os 6.0.1) shows the uninstalled apps. The apps was installed directly on the wear device from Studio.
即使卸载后,我的手表(moto360 第二代,运行 androidwear 1.5.03336103,Android os 6.0.1)显示已卸载的应用程序。这些应用程序是直接从 Studio 安装在穿戴设备上的。