0

The reason I want this, is that I need to run with --debug-init

First, I find the package name

$adb shell pm list packages |grep -i emac
package:org.gnu.emacs

Then I try to start it

$ adb shell am start -n org.gnu.emacs
Exception occurred while executing 'start':
java.lang.IllegalArgumentException: Bad component name: org.gnu.emacs
        at android.content.Intent.parseCommandArgs(Intent.java:8828)
        at com.android.server.am.ActivityManagerShellCommand.makeIntent(ActivityManagerShellCommand.java:398)
        at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:506)
        at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:222)
        at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
        at android.os.ShellCommand.exec(ShellCommand.java:38)
        at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:11206)
        at android.os.Binder.shellCommand(Binder.java:1085)
        at android.os.Binder.onTransact(Binder.java:903)
        at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:5643)
        at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3135)
        at android.os.Binder.execTransactInternal(Binder.java:1321)
        at android.os.Binder.execTransact(Binder.java:1280)

It says I need the ActivityName, but how can I find that?;)

$ adb shell am start -n org.gnu.emacs/.MainActivity
Starting: Intent { cmp=org.gnu.emacs/.MainActivity }
Error type 3
Error: Activity class {org.gnu.emacs/org.gnu.emacs.MainActivity} does not exist.

EDIT: I've installed Emacs from F-Droid.

2
  • What is the source of the Android Emacs package you have installed (what project)?
    – ebpa
    Nov 29, 2023 at 13:27
  • "The reason I want this, is that I need to run with --debug-init" I have a feeling that this might be an XY-problem considering that Android apps are not the same as console apps, meaning that starting Emacs Android app from the command line might not be what you want since you cannot put the flags similar to starting console apps. That said, the main activity is org.gnu.emacs.EmacsActivity. (Note: I only know about Android in general, having no Emacs knowledge)
    – Andrew T.
    Nov 29, 2023 at 16:15

1 Answer 1

0

You can just do:

adb shell am start -n org.gnu.emacs/org.gnu.emacs.EmacsActivity

;)

Your Answer

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

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