Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Android
  4. Why "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app?

Why "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app?

Scheduled Pinned Locked Moved Android
androidcomlinuxxmljson
11 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 12474576
    wrote on last edited by
    #1

    hi all: I have a problem: "adb shell uiautomator dump /sdcard/dump.xml" this commond can run on pc cmd,but can't use Runtime.getRuntime().exec() api to excute in app , i don't konw what's wrong, beacause of no execption i got. why other shell commond can run ok like "logcat", "ls " , ect i also research the android resource, find it use "app_process /system/bin com.android.commands.uiautomator.Launcher dump /scard/dump.xml" what can i do to run success of the commond "uiautomator dump /sdcard/dump.xml"

    L 1 Reply Last reply
    0
    • M Member 12474576

      hi all: I have a problem: "adb shell uiautomator dump /sdcard/dump.xml" this commond can run on pc cmd,but can't use Runtime.getRuntime().exec() api to excute in app , i don't konw what's wrong, beacause of no execption i got. why other shell commond can run ok like "logcat", "ls " , ect i also research the android resource, find it use "app_process /system/bin com.android.commands.uiautomator.Launcher dump /scard/dump.xml" what can i do to run success of the commond "uiautomator dump /sdcard/dump.xml"

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      What is the exact string you use in your call to exec?

      M D 2 Replies Last reply
      0
      • L Lost User

        What is the exact string you use in your call to exec?

        M Offline
        M Offline
        Member 12474576
        wrote on last edited by
        #3

        thanks, i use like that: Runtime.getRuntime().exec("uiautomator dump /sdcard/dump.xml")

        L U 2 Replies Last reply
        0
        • M Member 12474576

          thanks, i use like that: Runtime.getRuntime().exec("uiautomator dump /sdcard/dump.xml")

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          You need to provide the full path of the executable. Remember you are not running in a shell environment.

          L 1 Reply Last reply
          0
          • L Lost User

            What is the exact string you use in your call to exec?

            D Offline
            D Offline
            Divya Shah
            wrote on last edited by
            #5

            Thanks Writer For This Amazing Post ! It's Very Helpful to All People Regards, Hindi Pathshala | Dalal Stock

            1 Reply Last reply
            0
            • L Lost User

              You need to provide the full path of the executable. Remember you are not running in a shell environment.

              L Offline
              L Offline
              luisvaldez
              wrote on last edited by
              #6

              I couldn't get this to work either... what do you mean by provide the full path of the executable?

              L 1 Reply Last reply
              0
              • L luisvaldez

                I couldn't get this to work either... what do you mean by provide the full path of the executable?

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                I mean the complete path of the program, from the root directory. As a CTO you should understand this.

                L 1 Reply Last reply
                0
                • L Lost User

                  I mean the complete path of the program, from the root directory. As a CTO you should understand this.

                  L Offline
                  L Offline
                  luisvaldez
                  wrote on last edited by
                  #8

                  That's helpful... :laugh: I'm currently trying to run the uiautomator from within an app in android... and I'm not being able to... It keeps returning an exit code of 9. I have no idea where the uiautomator is located in the android os. Do you have any idea?

                  L 1 Reply Last reply
                  0
                  • L luisvaldez

                    That's helpful... :laugh: I'm currently trying to run the uiautomator from within an app in android... and I'm not being able to... It keeps returning an exit code of 9. I have no idea where the uiautomator is located in the android os. Do you have any idea?

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    luisvaldez wrote:

                    Do you have any idea?

                    Sorry, no. Try Testing UI for Multiple Apps | Android Developers[^].

                    L 1 Reply Last reply
                    0
                    • L Lost User

                      luisvaldez wrote:

                      Do you have any idea?

                      Sorry, no. Try Testing UI for Multiple Apps | Android Developers[^].

                      L Offline
                      L Offline
                      luisvaldez
                      wrote on last edited by
                      #10

                      beh... thanks anyway...

                      1 Reply Last reply
                      0
                      • M Member 12474576

                        thanks, i use like that: Runtime.getRuntime().exec("uiautomator dump /sdcard/dump.xml")

                        U Offline
                        U Offline
                        User 13329017
                        wrote on last edited by
                        #11

                        Hi, Were you able to run this? I've tried various solutions but none worked. Please share solution if you have got one. It would be great help.

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups