Appium 如何在 appium 测试代码中指定 activity 跳转

qq89757 · 2015年01月05日 · 最后由 cwen 回复于 2017年07月26日 · 1969 次阅读

求助:最近遇到在首次启动应用时需要在 wait for Activity 勾选下一个欢迎页面 WelcomeActivity,但是非首次登陆时又不需要勾选此项,而是需要勾选 LoginwaitActivity,不勾选启动就会报错,这样必须暂停 appium,这就失去意义了,也比较麻烦,有没有方法可以在代码里直接指定 Activity 的跳转呢?求大神指导下,本人 mac python 环境。

info: Welcome to Appium v1.3.3 (REV 34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78)

info: Appium REST http interface listener started on 127.0.0.1:2222
info: [debug] Non-default server args: {"app":"/Users/apple/Downloads/AUTO_APK/OneBox_Android_v1_9_3_53_2_20141212.apk","address":"127.0.0.1","port":2222,"callbackAddress":"127.0.0.1","callbackPort":2222,"noReset":true,"androidPackage":"com.huawei.onebox","androidActivity":"com.huawei.onebox.PreparedActivity","deviceName":"621d655c","platformName":"Android","platformVersion":"4.4","automationName":"Appium","language":"zh_CN","locale":"CN","robotAddress":"127.0.0.1","robotPort":2222,"defaultCommandTimeout":7200}
info: Console LogLevel: debug

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.3","revision":"34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78"}}}

info: <-- GET /wd/hub/status 200 7.187 ms - 104 {"status":0,"value":{"build":{"version":"1.3.3","revision":"34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78"}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.3","revision":"34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78"}}}

info: <-- GET /wd/hub/status 200 2.170 ms - 104 {"status":0,"value":{"build":{"version":"1.3.3","revision":"34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78"}}}
info: --> GET /wd/hub/sessions {}

info: [debug] Responding to client with success: {"status":0,"value":[]}
info: <-- GET /wd/hub/sessions 200 1.907 ms - 23 {"status":0,"value":[]}

info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"Android","locale":"CN","newCommandTimeout":"999999","deviceName":"621d655c","platformVersion":"4.4","language":"zh_CN","automationName":"Appium"}}

info: Client User-Agent string: Appium (unknown version) CFNetwork/720.0.7 Darwin/14.0.0 (x86_64)

info: [debug] Using local app from command line: /Users/apple/Downloads/AUTO_APK/OneBox_Android_v1_9_3_53_2_20141212.apk
info: [debug] Creating new appium session a4fbc730-26cd-4f86-a1f7-2f1a61a2254b
info: Starting android appium
info: [debug] Using fast reset? false
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: [debug] Checking whether adb is present

info: [debug] Using adb from /adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb
info: [debug] Setting Android Device Language to zh_CN
info: [debug] Setting Android Device Country to CN
info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" shell "setprop persist.sys.language zh_cn;setprop persist.sys.country CN;"

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" shell "stop; sleep 2; setprop sys.boot_completed 0; start"

info: [debug] waiting for reboot, this takes time.

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" shell "getprop sys.boot_completed"

info: Retrieving device

info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" devices

info: [debug] 1 device(s) connected

info: Found device 621d655c
info: [debug] Setting device id to 621d655c
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c wait-for-device

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "echo 'ready'"

info: [debug] Starting logcat capture

info: [debug] Getting device API level

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "getprop ro.build.version.sdk"

info: [debug] Logcat terminated with code 1, signal null

info: [debug] Device is at API Level 19

info: Device API level is: 19
info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "getprop persist.sys.language"

info: [debug] Current device language: zh

info: [debug] java -jar "/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/jars/appium_apk_tools.jar" "stringsFromApk" "/Users/apple/Downloads/AUTO_APK/OneBox_Android_v1_9_3_53_2_20141212.apk" "/tmp/com.huawei.onebox" zh

info: [debug] No strings.xml for language 'zh', getting default strings.xml

info: [debug] java -jar "/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/jars/appium_apk_tools.jar" "stringsFromApk" "/Users/apple/Downloads/AUTO_APK/OneBox_Android_v1_9_3_53_2_20141212.apk" "/tmp/com.huawei.onebox"

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c push "/tmp/com.huawei.onebox/strings.json" /data/local/tmp

info: [debug] Checking whether aapt is present

info: [debug] Using aapt from /adt-bundle-mac-x86_64-20131030/sdk/build-tools/android-4.4/aapt
info: [debug] processFromManifest: "/adt-bundle-mac-x86_64-20131030/sdk/build-tools/android-4.4/aapt" dump xmltree "/Users/apple/Downloads/AUTO_APK/OneBox_Android_v1_9_3_53_2_20141212.apk" AndroidManifest.xml

info: [debug] Set app process to: com.huawei.onebox

info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Checking app cert for /Users/apple/Downloads/AUTO_APK/OneBox_Android_v1_9_3_53_2_20141212.apk: java -jar "/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/jars/verify.jar" "/Users/apple/Downloads/AUTO_APK/OneBox_Android_v1_9_3_53_2_20141212.apk"

info: [debug] App already signed.

info: [debug] Zip-aligning /Users/apple/Downloads/AUTO_APK/OneBox_Android_v1_9_3_53_2_20141212.apk
info: [debug] Checking whether zipalign is present
info: [debug] Using zipalign from /adt-bundle-mac-x86_64-20131030/sdk/tools/zipalign

info: [debug] zipAlignApk: "/adt-bundle-mac-x86_64-20131030/sdk/tools/zipalign" -f 4 "/Users/apple/Downloads/AUTO_APK/OneBox_Android_v1_9_3_53_2_20141212.apk" "/var/folders/6d/_9nw53151rvc52dvxngh76vr0000gn/T/appium11505-26629-14zygwy.tmp"

info: [debug] MD5 for app is 2aa655fd2f3e5dafbb5747400fe36638

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "ls /data/local/tmp/2aa655fd2f3e5dafbb5747400fe36638.apk"

info: [debug] Getting install status for com.huawei.onebox

info: [debug] Getting device API level
info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "getprop ro.build.version.sdk"

info: [debug] Device is at API Level 19

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "pm list packages -3 com.huawei.onebox"

info: [debug] App is not installed

info: Installing App
info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "mkdir -p /data/local/tmp/"

info: [debug] Removing any old apks

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "ls /data/local/tmp/*.apk"

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell rm "/data/local/tmp/5cecf0458e39766fa8f83ed3c98af2ce.apk"

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c push "/Users/apple/Downloads/AUTO_APK/OneBox_Android_v1_9_3_53_2_20141212.apk" /data/local/tmp/2aa655fd2f3e5dafbb5747400fe36638.apk

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.3","revision":"34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78"}},"sessionId":"a4fbc730-26cd-4f86-a1f7-2f1a61a2254b"}
info: <-- GET /wd/hub/status 200 1.331 ms - 155 {"status":0,"value":{"build":{"version":"1.3.3","revision":"34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78"}},"sessionId":"a4fbc730-26cd-4f86-a1f7-2f1a61a2254b"}

info: [debug] Uninstalling com.huawei.onebox

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "am force-stop com.huawei.onebox"

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c uninstall com.huawei.onebox

info: [debug] App was not uninstalled, maybe it wasn't on device?

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "pm install -r /data/local/tmp/2aa655fd2f3e5dafbb5747400fe36638.apk"

info: [debug] Forwarding system:4724 to device:4724

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c forward tcp:4724 tcp:4724

info: [debug] Pushing appium bootstrap to device...
info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c push "/Applications/Appium.app/Contents/Resources/node_modules/appium/build/android_bootstrap/AppiumBootstrap.jar" /data/local/tmp/

info: [debug] Pushing settings apk to device...

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c install "/Applications/Appium.app/Contents/Resources/node_modules/appium/build/settings_apk/settings_apk-debug.apk"

info: [debug] Pushing unlock helper app to device...

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c install "/Applications/Appium.app/Contents/Resources/node_modules/appium/build/unlock_apk/unlock_apk-debug.apk"

info: Starting App

info: [debug] Attempting to kill all 'uiautomator' processes
info: [debug] Getting all processes with 'uiautomator'
info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "ps 'uiautomator'"

info: [debug] No matching processes found

info: [debug] Running bootstrap
info: [debug] spawning: /adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb -s 621d655c shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap

info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1

info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1

info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
info: [debug] [BOOTSTRAP] [debug] Loading json...
info: [debug] Waking up device if it's not alive
info: [debug] Pushing command to appium work queue: ["wake",{}]

info: [debug] [BOOTSTRAP] [debug] json loading complete.
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] [BOOTSTRAP] [debug] Client connected
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"wake","params":{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: wake
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window"

info: [debug] Screen already unlocked, continuing.

info: [debug] Pushing command to appium work queue: ["getDataDir",{}]

info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"\/data\/local\/tmp","status":0}
info: [debug] dataDir set to: /data/local/tmp
info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"compressedLayoutHierarchy","params":{"compressLayout":false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":false,"status":0}
info: [debug] Getting device API level
info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "getprop ro.build.version.sdk"

info: [debug] Device is at API Level 19

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.huawei.onebox/com.huawei.onebox.PreparedActivity"

info: [debug] Waiting for pkg "com.huawei.onebox" and activity "com.huawei.onebox.PreparedActivity" to be focused

info: [debug] Getting focused package and activity
info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Getting focused package and activity

info: [debug] executing: "/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 621d655c shell "dumpsys window windows"

info: [debug] Stopping logcat capture

info: [debug] Logcat already stopped

error: com.huawei.onebox/.PreparedActivity never started. Current: com.huawei.onebox/.WelcomeActivity

info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"}
info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"OK, shutting down","status":0}
info: [debug] [BOOTSTRAP] [debug] Closed client connection
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
info: [debug] [UIAUTOMATOR STDOUT] Time: 21.918
info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1

error: Failed to start an Appium session, err was: Error: com.huawei.onebox/.PreparedActivity never started. Current: com.huawei.onebox/.WelcomeActivity

info: [debug] UiAutomator shut down normally
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
info: [debug] Error: com.huawei.onebox/.PreparedActivity never started. Current: com.huawei.onebox/.WelcomeActivity
    at null.<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:1323:12)
    at null.<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:1267:7)
    at null.<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:172:9)
    at ChildProcess.exithandler (child_process.js:646:7)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Socket.<anonymous> (child_process.js:969:11)
    at Socket.emit (events.js:95:17)
    at Pipe.close (net.js:465:12)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: com.huawei.onebox/.PreparedActivity never started. Current: com.huawei.onebox/.WelcomeActivity)","origValue":"com.huawei.onebox/.PreparedActivity never started. Current: com.huawei.onebox/.WelcomeActivity"},"sessionId":null}

info: <-- POST /wd/hub/session 500 41441.729 ms - 310 

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.3","revision":"34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78"}}}
info: <-- GET /wd/hub/status 200 1.697 ms - 104 {"status":0,"value":{"build":{"version":"1.3.3","revision":"34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78"}}}

这里是没有勾选 wait for Activity 里的 WelcomeActivity 启动时的 appium 日志信息,但是手机是被启动了,停在欢迎页面,日志报错,也获取不了属性,不能继续操作

共收到 11 条回复 时间 点赞

发帖的时候,遵守下发帖的规矩,好吧?

本人第一次发帖,要是没有遵守到规则的也请大家海涵!

眼都花了。。。

driver.startActivity("com.android.camera", ".CameraLauncher");
试试

请问您这个问题解决了吗?我也遇到了同样的问题~

#5 楼 @zqting124 解决了,使用 driver.setCapability("","") 重现设置需要启动页面

@qq89757 请问下具体怎么添加?重新在 setup 里设置吗?

好像不需要这么麻烦,在 appium 的 gui 里面设置 no reset 和 stop on reset ,不勾选 wait for Activity 之类的,就可以了

Aquarius、 [该话题已被删除] 中提及了此贴 08月03日 18:06

我也遇到了同样的问题,首次启动到 LoginActivity,跳转到 PersonalInfoActivity,直接挂了。提示:selenium.common.exceptions.WebDriverException: Message: A new session could not be created. (Original error: Requested a new session but one was in progress)

问题已经解决,我的方案是,在 appium-desktop 桌面版中勾选 no reset 即可。

我这边调用 startActivity ,报 AttributeError: 'WebDriver' object has no attribute 'startActivity' 错误。。不知道怎么解

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册