gnirehtet icon indicating copy to clipboard operation
gnirehtet copied to clipboard

Can start app on Android 11 / Samsung S20 FE

Open JeffreyDraaijer opened this issue 4 years ago • 9 comments

Hi,

Running the command gnirehtet start and gnirehtet run doesn't start the application on my Android device. The command being executed as mentioned in the documentation: "adb shell am start -a com.genymobile.gnirehtet.START
-n com.genymobile.gnirehtet/.GnirehtetActivity".

Changing the command to: "adb shell "am start -n com.genymobile.gnirehtet/.GnirehtetActivity -a com.genymobile.gnirehtet.START"" does work for my Android device.

I don't know if this is an issue, but wanted to let you know.

Cheers, Jeffrey

JeffreyDraaijer avatar Feb 09 '21 13:02 JeffreyDraaijer

Running the command gnirehtet start and gnirehtet run doesn't start the application on my Android device.

Which Android version? So the only thing you change is the order of the -n ... and -a ... parameter, or the double-quote " change is significant?

Could you please post the logcat when you do that?

adb logcat -c  # clear
adb shell am start -a com.genymobile.gnirehtet.START -n com.genymobile.gnirehtet/.GnirehtetActivity
adb logcat -d logcat.txt

Then post the logcat.

rom1v avatar Feb 09 '21 13:02 rom1v

Hi Romain,

Running the command like the below gives me an error.

adb shell am start -a com.genymobile.gnirehtet.START
-n com.genymobile.gnirehtet/.GnirehtetActivity

But running the same command without the break line it works:

adb shell am start -a com.genymobile.gnirehtet.START -n com.genymobile.gnirehtet/.GnirehtetActivity

JeffreyDraaijer avatar Feb 09 '21 14:02 JeffreyDraaijer

Oh yes, that's expected.

If you want to break a line, you need a \ in shell:

adb shell am start -a com.genymobile.gnirehtet.START \
    -n com.genymobile.gnirehtet/.GnirehtetActivity

(oh ok I did a copy-paste which included a newline in my previous message, I fixed it)

rom1v avatar Feb 09 '21 14:02 rom1v

So:

adb shell am start -a com.genymobile.gnirehtet.START -n com.genymobile.gnirehtet/.GnirehtetActivity

works, but ./gnirehtet start does not? What's the output?

rom1v avatar Feb 09 '21 14:02 rom1v

The output is

gnirehtet start
2021-02-09 15:53:18.779 I Gnirehtet: Checking gnirehtet client...

We should expect: Starting: Intent { act=com.genymobile.gnirehtet.START cmp=com.genymobile.gnirehtet/.GnirehtetActivity }

gnirehtet stop
2021-02-09 15:53:59.489 I Gnirehtet: Stopping client...
Starting: Intent { act=com.genymobile.gnirehtet.STOP cmp=com.genymobile.gnirehtet/.GnirehtetActivity }

JeffreyDraaijer avatar Feb 09 '21 14:02 JeffreyDraaijer

2021-02-09 15:53:18.779 I Gnirehtet: Checking gnirehtet client...

Could you execute:

adb shell dumpsys package com.genymobile.gnirehtet

rom1v avatar Feb 11 '21 11:02 rom1v

2021-02-09 15:53:18.779 I Gnirehtet: Checking gnirehtet client...

Could you execute:

adb shell dumpsys package com.genymobile.gnirehtet

Sure, what information do you need from the output?

JeffreyDraaijer avatar Feb 11 '21 12:02 JeffreyDraaijer

None, it's just where it seems it is blocked when you call gnirehtet start:

https://github.com/Genymobile/gnirehtet/blob/f5c0710c751f7ca82ce413058abc57d9af7208c3/relay-rust/src/main.rs#L538-L542

rom1v avatar Feb 11 '21 12:02 rom1v

That command is working without a problem. For the time I've created my own .cmd file and it's running the following commands.

@adb reverse localabstract:gnirehtet tcp:31416
@adb shell dumpsys package com.genymobile.gnirehtet
@adb shell "am start -a com.genymobile.gnirehtet.START -n com.genymobile.gnirehtet/.GnirehtetActivity"
@java -jar gnirehtet.jar relay 
@pause

JeffreyDraaijer avatar Feb 16 '21 12:02 JeffreyDraaijer