简体   繁体   English

如何调试已使用Google+登录的Android应用?

[英]How to debug Android app that has login with Google+?

I develop an android app that has a login form using Google+. 我开发了一个使用Google+登录表单的android应用。 The problem is everytime I want to debug the app after modify the codings, I need to generate signed APK, and manually installed to tablet, then debug the app. 问题是,每次修改编码后我想调试应用程序时,都需要生成签名的APK,并手动安装到平板电脑上,然后调试应用程序。 If not doing like that, GoogleSignInResult result.isSuccess always return false. 如果不这样做,GoogleSignInResult result.isSuccess始终返回false。 However, doing like that, at most of the times it will return false. 但是,这样做的话,大多数情况下它将返回false。 Sometimes it return success. 有时它会返回成功。 It depends on luck. 这取决于运气。 So how to properly debug this app? 那么如何正确调试该应用程序呢?

U can't debug signed Apk... U can get log messages through txt file. U无法调试签名的Apk ... U可以通过txt文件获取日志消息。

Call below method wherever u want like in onActivityResult print requestCode, responseCode 在onActivityResult打印requestCode,responseCode中的任何位置调用以下方法

private void log(String message) {
    File file=new File(Environment.getExternalStorageDirectory()+"/"+"log.txt");
    try {
        FileWriter fileWriter=new FileWriter(file,true);
        fileWriter.append(message);
        fileWriter.flush();
        fileWriter.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM