MuntashirAkon/AppManager

custon command doesn't work under ADB Shell

kdxhub opened this issue · 3 comments

Please check before submitting an issue

  • I know what my device, OS and App Manager versions are
  • I know how to take logs
  • I know how to reproduce the issue which may not be specific to my device

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

  • Device: Redmi Note 12T Pro (China)
  • OS Version: HyperOS 1.0.2 (Android 14)
  • App Manager Version: 4.0.0-beta01 (436)
  • Mode: App mode: Non-root and try to run it under ADB by ADB Shell

Additional context

No response

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

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?

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...