MuntashirAkon / AppManager

A full-featured package manager and viewer for Android
https://muntashirakon.github.io/AppManager/
Other
4.86k stars 276 forks source link

custon command doesn't work under ADB Shell #1453

Closed kdxhub closed 1 week ago

kdxhub commented 2 weeks ago

Please check before submitting an issue

Describe the bug

as the help, i try to run AppManager under a ADB Shell provided by Shizuku (Wireless ADB)

but neither Termux with ADB Access or Automatically App couldn't work.

they will return command run successfully but there isn't any change in AppManager

To Reproduce

  1. Go SettingsMode of operation
  2. Copy the command in Custom Command
  3. Run it in Termux with ADB Shell Access
  4. See it doesn't work with error log.

Expected behavior

AppManager will run under ADB Shell

Screenshots

Screenshot_2024-10-03-23-05-08-047_io github muntashirakon AppManager Screenshot_2024-10-03-23-05-34-861_com termux

Logs

Starting am_local_server...
Jar path: /storage/emulated/0/Android/data/io.github.muntashirakon.AppManager/cache/am.jar
Args: path:60001,app:io.github.muntashirakon.AppManager,bgrun:1,token:jab-venue-storm-deaf-panty
Local server has started.
Arguments: [path:60001,app:io.github.muntashirakon.AppManager,bgrun:1,token:jab-venue-storm-deaf-panty, 60001, jab-venue-storm-deaf-panty]
UID: 2000, UID: 2000
Params: ConfigParam{mIsDebug=false, mPath='60001', mRunInBackground=true, mToken='jab-venue-storm-deaf-panty', mUid='2000'}
Config params: ConfigParam{mIsDebug=false, mPath='60001', mRunInBackground=true, mToken='jab-venue-storm-deaf-panty', mUid='2000'}
Error! Could not start server. bind failed: EADDRINUSE (Address already in use)
java.net.BindException: bind failed: EADDRINUSE (Address already in use)
    at libcore.io.IoBridge.bind(IoBridge.java:149)
    at java.net.PlainSocketImpl.socketBind(PlainSocketImpl.java:162)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:427)
    at java.net.ServerSocket.bind(ServerSocket.java:399)
    at java.net.ServerSocket.<init>(ServerSocket.java:259)
    at java.net.ServerSocket.<init>(ServerSocket.java:151)
    at io.github.muntashirakon.AppManager.server.Server$NetSocketServerImpl.<init>(Server.java:176)
    at io.github.muntashirakon.AppManager.server.Server.<init>(Server.java:66)
    at io.github.muntashirakon.AppManager.server.ServerHandler.<init>(ServerHandler.java:57)
    at io.github.muntashirakon.AppManager.server.ServerRunner.runServer(ServerRunner.java:189)
    at io.github.muntashirakon.AppManager.server.ServerRunner.lambda$main$0(ServerRunner.java:86)
    at io.github.muntashirakon.AppManager.server.ServerRunner$$ExternalSyntheticLambda1.run(Unknown Source:2)
    at java.lang.Thread.run(Thread.java:1012)
Caused by: android.system.ErrnoException: bind failed: EADDRINUSE (Address already in use)
    at libcore.io.Linux.bind(Native Method)
    at libcore.io.ForwardingOs.bind(ForwardingOs.java:138)
    at libcore.io.IoBridge.bind(IoBridge.java:145)
    ... 12 more

Killing self process with pid 6392

Device info

Additional context

No response

EatHatsuneShallots commented 1 week ago

Please check if the server is running Try use killall am_local_server before execute

kdxhub commented 1 week ago

thanks

but it actually worked after i runned follow command and restart AppManager

killall am_local_server
sh /storage/emulated/0/Android/data/io.github.muntashirakon.AppManager/cache/run_server.sh 60001 thorn-robin-goofy-shirt-owl

it also seems that AppManager needs persistent shell environment?

EatHatsuneShallots commented 1 week ago

but it actually worked after i runned follow command and restart AppManager

However, sometimes the server can't be connected, in which case you'll need to kill the server manually You can see the related issues: #1451

it also seems that AppManager needs persistent shell environment?

You just need to make sure that the server doesn't get killed E.g: Disabling USB Debugging, Killed by system, Hard rebooting...