Appium [已解决]MAC 下 Appium 无法运行 android app

tomchen · December 24, 2013 · Last by 恒温 replied at December 25, 2013 · 993 hits

Log如下:

info: Welcome to Appium v0.12.3

info: Appium REST http interface listener started on 127.0.0.1:4723
info - socket.io started

info: Not spawning instruments force-quit watcher since it only works on 10.9 and you have 10.8.5

info: Responding to client with success: {"status":0,"value":{"build":{"version":"0.12.3","revision":"c8abd030c0cedcc387532f2aa986fd956e46eb4f"}}}

debug: Appium request initiated at /wd/hub/status

debug: Request received with params: {}

GET /wd/hub/status 200 7ms - 144b

debug: Appium request initiated at /wd/hub/status

info: Responding to client with success: {"status":0,"value":{"build":{"version":"0.12.3","revision":"c8abd030c0cedcc387532f2aa986fd956e46eb4f"}}}

debug: Request received with params: {}
debug: Appium request initiated at /wd/hub/sessions
debug: Request received with params: {}
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"desiredCapabilities":{}}
debug: Using fast reset? true
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb devices
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb devices
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb -s emulator-5554 wait-for-device
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb -s emulator-5554 shell "echo 'ready'"
debug: java -jar "/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/helpers/strings_from_apk.jar" "/Users/DEV/Documents/workspace/com.tet/bin/com.tet.apk" "/tmp/com.tet"
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb -s emulator-5554 push "/tmp/com.tet/strings.json" /data/local/tmp
debug: Not uninstalling app since server not started with --full-reset
debug: Getting install status for com.tet
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb -s emulator-5554 shell "pm list packages -3 com.tet"
debug: Appium request initiated at /wd/hub/status
debug: Request received with params: {}
debug: Checking app cert for /Users/DEV/Documents/workspace/com.tet/bin/com.tet.apk: java -jar "/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/helpers/verify.jar" "/Users/DEV/Documents/workspace/com.tet/bin/com.tet.apk"
debug: App already signed.
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb -s emulator-5554 shell "mkdir -p /data/local/tmp/"
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb -s emulator-5554 shell "ls /data/local/tmp/*.apk"
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb -s emulator-5554 shell "pm install -r /data/local/tmp/d8d9ae3690a01c36383f302d88180304.apk"
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb -s emulator-5554 forward tcp:4724 tcp:4724
debug: Pushing appium bootstrap to device...
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb -s emulator-5554 push "/Applications/Appium.app/Contents/Resources/node_modules/appium/build/android_bootstrap/AppiumBootstrap.jar" /data/local/tmp/
debug: Pushing unlock helper app to device...
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb -s emulator-5554 install /Applications/Appium.app/Contents/Resources/node_modules/appium/build/unlock_apk/unlock_apk-debug.apk
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb -s emulator-5554 shell "ps | grep 'uiautomator'"
debug: spawning: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb -s emulator-5554 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap
debug: Waking up device if it's not alive
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb -s emulator-5554 shell "dumpsys window"
debug: Screen already unlocked, continuing.
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb -s emulator-5554 shell "am start -S -n com.tet/MainActivity"
debug: executing: /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb -s emulator-5554 shell "am start -S -n com.tet/.MainActivity"
error: Activity used to start app doesn't exist! Make sure it exists
error: Failed to start an Appium session, err was: Error: Activity used to start app doesn't exist! Make sure it
GET /wd/hub/status 200 1ms - 144b
info: Responding to client with success: {"status":0,"value":[]}
GET /wd/hub/sessions 200 0ms - 32b
info: Using local app from command line: /Users/DEV/Documents/workspace/com.tet/bin/com.tet.apk
info: Creating new appium session 910642c6-205b-4d1d-87bf-751ecfbb275b
info: Starting android appium
info: Preparing device for session
info: Checking whether app is actually present
info: Checking whether adb is present
info: [ADB] Using adb from /Users/DEV/Desktop/realwork/Android/adt/sdk/platform-tools/adb

info: Getting running AVD name
info: Sending telnet command to device: avd name
info: Getting running emulator port
info: [ADB] Getting connected devices...
info: [ADB] 1 device(s) connected
info: Socket connection to device created
info: Socket connection to device ready
info: Telnet command got response: App
info: Did not launch AVD because it was already running.
info: Trying to find a connected android device
info: [ADB] Getting connected devices...
info: [ADB] 1 device(s) connected
info: Setting device id to emulator-5554
info: [ADB] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: Starting logcat capture
info: Responding to client with success: {"status":0,"value":{"build":{"version":"0.12.3","revision":"c8abd030c0cedcc387532f2aa986fd956e46eb4f"}},"sessionId":"910642c6-205b-4d1d-87bf-751ecfbb275b"}
GET /wd/hub/status 200 0ms - 199b
info: [ADB] App is not installed
info: MD5 for app is d8d9ae3690a01c36383f302d88180304
info: Removing any old apks
info: Found an apk we want to keep at /data/local/tmp/d8d9ae3690a01c36383f302d88180304.apk
info: Couldn't find any apks to remove
info: [ADB] Forwarding system:4724 to device:4724
info: Attempting to kill all 'uiautomator' processes
info: Getting all processes with 'uiautomator'
info: No matching processes found
info: Running bootstrap
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
info: [BOOTSTRAP] [info] Socket opened on port 4724
info: [BOOTSTRAP] [info] Appium Socket Server Ready
info: [BOOTSTRAP] [info] Loading json...
info: Pushing command to appium work queue: ["wake",{}]
info: [BOOTSTRAP] [info] json loading complete.
info: [BOOTSTRAP] [info] Client connected
info: [BOOTSTRAP] [info] Got data from client: {"cmd":"action","action":"wake","params":{}}
info: [BOOTSTRAP] [info] Got command of type ACTION
info: [BOOTSTRAP] [debug] Got command action: wake
info: [BOOTSTRAP] [info] Returning result: {"value":true,"status":0}
info: Writing dumpsys output to /Applications/Appium.app/Contents/Resources/node_modules/appium/.dumpsys.log
info: We tried to start an activity that doesn't exist, retrying with . prepended to activity
info: Stopping logcat capture
info: [BOOTSTRAP] [info] Got data from client: {"cmd":"shutdown"}
info: [BOOTSTRAP] [info] Got command of type SHUTDOWN
info: [BOOTSTRAP] [info] Returning result: {
exists

"value":"OK, shutting down","status":0}
info: [BOOTSTRAP] [info] Closed client connection
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: Sent shutdown command, waiting for UiAutomator to stop...
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
info: [UIAUTOMATOR STDOUT] Time: 11.415
info: [UIAUTOMATOR STDOUT] OK (1 test)
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
info: UiAutomator shut down normally
info: Cleaning up android objects
info: Cleaning up appium session
info: Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Activity used to start app doesn't exist! Make sure it exists)","origValue":"Activity used to start app doesn't exist! Make sure it exists"},"sessionId":null}
POST /wd/hub/session 500 27363ms - 272b

弹出以下报告:

一直提示:error: Activity used to start app doesn't exist! Make sure it exists

配置:Appium 0.12.3 , Api level =19 , AVD android 4.4

但是该App是可以正常运行的,求指导呀

答:输入Package 的路径输入错误。

共收到 5 条回复 时间 点赞

@lihuazhang 能帮我看看吗?

#2楼 @lihuazhang Package 跟 Activity 是为了设置启动的页面的吗?

#2楼 @lihuazhang Package 跟 Activity 其实是为了设置什么?

#4楼 @dippa 启动应用得能定位到。

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up