首次安装应用可以成功执行脚本,但是以非重新安装 apk 方式启动 appium,会报 LauncherActivity 未启动导致的 session 创建失败,应该和首页的新手教程有关,重新安装的时候有新手教程,可以正常启动,非全新安装进去的时候没有新手教程,所以会失败,但是不知道该怎么改!
具体日志信息如下,希望了解的朋友可以帮个忙,非常感谢!!!
info: [debug] Waiting for pkg "com.tianqi.tqweather" and activity "com.tianqi.tqweather.LauncherActivity" to be focused
info: [debug] Getting focused package and activity
info: [debug] executing cmd: D:\android-sdk\platform-tools\adb.exe -s 71UBBLJ229
93 shell "dumpsys window windows"
info: [debug] Getting focused package and activity
info: [debug] executing cmd: D:\android-sdk\platform-tools\adb.exe -s 71UBBLJ229
93 shell "dumpsys window windows"
error: Failed to start an Appium session, err was: Error: com.tianqi.tqweather/.La
uncherActivity never started. Current: com.tianqi.tqweather/.MainActivity
info: [debug] Error: com.tianqi.tqweather/.LauncherActivity never started. Current
: com.tianqi.tqweather/.MainActivity
at [object Object].<anonymous> (D:\Program Files\Appium\node_modules\appium\
node_modules\appium-adb\lib\adb.js:1314:12)
at [object Object].<anonymous> (D:\Program Files\Appium\node_modules\appium\
node_modules\appium-adb\lib\adb.js:1258:7)
at [object Object].<anonymous> (D:\Program Files\Appium\node_modules\appium\
node_modules\appium-adb\lib\adb.js:180:9)
at ChildProcess.exithandler (child_process.js:204:7)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"
A new session could not be created. (Original error: com.tianqi.tqweather/.Launche
rActivity never started. Current: com.tianqi.tqweather/.MainActivity)","origValue"
:"com.tianqi.tqweather/.LauncherActivity never started. Current: com.tianqi.tqweather/.MainActivity"},"sessionId":null}
info: <-- POST /wd/hub/session 500 28590.155 ms - 308