11

In the example code below, how can I add a command to print the values of v0, v1 etc to logcat?

const v1, 0x7f05002e

iget-object v2, p0, Lcom/company/myapp/MainActivity;->d:Lcom/company/myapp/f;

invoke-virtual {v2}, Lcom/company/myapp/f;->getPanelModel()Lcom/company/myapp/h;

move-result-object v2

invoke-virtual {v2}, Lcom/company/myapp/h;->b()I

move-result v2

invoke-virtual {v0, v1, v2}, Lcom/company/e/k;->a(II)V

iget-object v0, p0, Lcom/company/myapp/MainActivity;->c:Lcom/company/e/k;

1 Answer 1

31

Add at the end:

const-string v8, "log-tag"

invoke-static {v1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v9

invoke-static {v8, v9}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

From your sample v1 is integer so the function String;->valueOf(I) is used to convert it to String before using log. Also Log;->d outputs at debug log level; possibly another level is needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.