如何在 android studio 3.3.1 中以调试模式运行应用程序?

VSB

在此之前,我会使用 android studio 中的调试图标或按 Shift+F9 在调试模式下运行 android 应用程序。在一些更新后在我的 android studio 中执行此操作会导致安装调试版本(不运行它)。即使没有模拟器或没有设备连接并在线,它也不会提示目标设备选择窗口(选择某些东西或运行新的模拟器)。

我想知道应该使用哪个命令来安装调试版本,运行它并将调试器附加到应用程序进行调试?

目前我需要执行以下步骤:installDebug,然后在设备内手动运行应用程序,然后将调试器附加到它。

我目前的软件配置如下:

  • Android Studio 3.3.1 - 构建于 2019 年 1 月 29 日
  • Gradle 插件:3.3.1
  • distributionUrl设置为https\://services.gradle.org/distributions/gradle-4.10.3-all.zipinside gradle-wrapper.properties

以下是可用的 gradle 任务列表:

------------------------------------------------------------
All tasks runnable from root project
------------------------------------------------------------

Android tasks
-------------
androidDependencies - Displays the Android dependencies of the project.
signingReport - Displays the signing info for the base and test modules
sourceSets - Prints out all the source sets defined in this project.

Build tasks
-----------
assemble - Assemble main outputs for all the variants.
assembleAndroidTest - Assembles all the Test applications.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
bundle - Assemble bundles for all the variants.
clean - Deletes the build directory.
cleanBuildCache - Deletes the build cache directory.
compileDebugAndroidTestSources
compileDebugSources
compileDebugUnitTestSources
compileReleaseNonObfuscatedSources
compileReleaseNonObfuscatedUnitTestSources
compileReleaseSources
compileReleaseUnitTestSources

Build Setup tasks
-----------------
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.

Cleanup tasks
-------------
lintFix - Runs lint on all variants and applies any safe suggestions to the source code.

Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'myproject'.
components - Displays the components produced by root project 'myproject'. [incubating]
dependencies - Displays all dependencies declared in root project 'myproject'.
dependencyInsight - Displays the insight into a specific dependency in root project 'myproject'.
dependentComponents - Displays the dependent components of components in root project 'myproject'. [incubating]
help - Displays a help message.
model - Displays the configuration model of root project 'myproject'. [incubating]
projects - Displays the sub-projects of root project 'myproject'.
properties - Displays the properties of root project 'myproject'.
tasks - Displays the tasks runnable from root project 'myproject' (some of the displayed tasks may belong to subprojects).

Install tasks
-------------
installDebug - Installs the Debug build.
installDebugAndroidTest - Installs the android (on device) tests for the Debug build.
uninstallAll - Uninstall all applications.
uninstallDebug - Uninstalls the Debug build.
uninstallDebugAndroidTest - Uninstalls the android (on device) tests for the Debug build.
uninstallRelease - Uninstalls the Release build.
uninstallReleaseNonObfuscated - Uninstalls the ReleaseNonObfuscated build.

Verification tasks
------------------
check - Runs all checks.
connectedAndroidTest - Installs and runs instrumentation tests for all flavors on connected devices.
connectedCheck - Runs all device checks on currently connected devices.
connectedDebugAndroidTest - Installs and runs the tests for debug on connected devices.
deviceAndroidTest - Installs and runs instrumentation tests using all Device Providers.
deviceCheck - Runs all device checks using Device Providers and Test Servers.
lint - Runs lint on all variants.
lintDebug - Runs lint on the Debug build.
lintRelease - Runs lint on the Release build.
lintReleaseNonObfuscated - Runs lint on the ReleaseNonObfuscated build.
lintVitalRelease - Runs lint on just the fatal issues in the release build.
test - Run unit tests for all variants.
testDebugUnitTest - Run unit tests for the debug build.
testReleaseNonObfuscatedUnitTest - Run unit tests for the releaseNonObfuscated build.
testReleaseUnitTest - Run unit tests for the release build.
森蒂尔·维兰·尚穆根

按 Ctrl + alt + F5 (其中 Shift + F9 启动应用程序是调试模式)

或选择运行 -> 附加到进程

选择应用程序的签名,以启用调试模式,该模式已通过 adb 安装。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何在Android Studio中拍摄运行Flutter应用程序的移动调试设备的屏幕截图?

如何在Visual Studio(Android)中包含OpenGLES 3

如何检测已编译应用程序中的错误?(Android Studio 3+)

如何在Android Studio中终止应用程序-在单独的设备上运行的应用程序

如何在USB连接的设备上的Android Studio中调试应用程序升级

无法通过版本3在Android中运行应用程序

如何在AIR Android应用程序中在JS和AS3之间进行通信?

如何在android studio模拟器中运行vuzix android glass应用程序?

如何在不从Android Studio重新上传的情况下在设备上重新运行应用程序的调试版本?

如何在Android Studio上使用3rd party程序/插件?

Android:如何将此应用程序从 GLES1 移植到 GLES3

如何在生产模式Ionic3中构建应用程序?

如何在Android Studio中的3个或更多活动之间传递数据?

如何在Android Studio中获取Google Pixel 3模拟器?

如何在Android Studio中关联.mp3文件

如何在android studio中更改应用程序的版本

如何在android studio中删除应用程序的名称

如何在Visual Studio 2015中编写API方法Node.js Express 3应用程序

如何停止等待调试器附加的Android Studio中内置的Android应用程序?

如何在Visual Studio调试中以管理员身份运行应用程序?

如何在i3中运行Gnome启动应用程序?

如何在正在运行的Gtk3应用程序中修改字体大小?

如何在android studio中以编程方式在最近的应用程序中锁定应用程序

如何在GNOME 3中编辑“应用程序”菜单?

如何在Visual Studio 2017的真实手机上调试Android应用程序?

如何在Ionic3,Cordova和Angular4应用程序中获取android设备的语言?

如何加快Android Studio 2.3或3的速度?

Android Studio:运行/调试应用程序的发行版本

Android Studio无法运行以调试应用程序