问题描述
我正在学习一些有关在 Android Studio 中构建应用程序的教程,但由于某种原因,当我单击运行"时,它没有启动/安装我的应用程序的最新版本.我必须手动卸载手机上的应用程序,然后在 Android Studio 中进行更改后单击运行以更新应用程序.有什么想法吗?
I'm following some tutorials about building apps in Android Studio, but for some reason it's not launching/installing the latest version of my app when I click 'run'. I have to manually uninstall the app on the phone and then click run after making changes in Android Studio for the app to get updated. Any ideas?
这是控制台输出:
Waiting for device.
Target device: htc-htc_one_m8
Uploading file
local path: /home/brandon/AndroidStudioProjects/JustJava/app/build/outputs/apk/app-debug.apk
remote path: /data/local/tmp/com.example.android.justjava
No apk changes detected. Skipping file upload, force stopping package instead.
DEVICE SHELL COMMAND: am force-stop com.example.android.justjava
Launching application: com.example.android.justjava/com.example.android.justjava.MainActivity.
DEVICE SHELL COMMAND: am start -D -n "com.example.android.justjava/com.example.android.justjava.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.android.justjava/.MainActivity }
Waiting for process: com.example.android.justjava
Connected to the target VM, address: 'localhost:8638', transport: 'socket'
Disconnected from the target VM, address: 'localhost:8638', transport: 'socket'
推荐答案
Android Studio 认为没有变化,不会安装新的 APK.解决方法是在运行 > 编辑配置中禁用如果 APK 未更改则跳过安装"选项.
Android Studio thinks that there are no changes and doesn't install the new APK. A workaround is to disable the "Skip installation if APK has not changed" option in Run > Edit Configurations.
我使用的是 Android Studio 1.4
来源:https://code.google.com/p/android/issues/detail?id=160901
I'm using Android Studio 1.4
Source: https://code.google.com/p/android/issues/detail?id=160901
这篇关于Android Studio 不会在设备上安装最新的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!