appium 1.2.0 android 4.1.1
启动代码如下:
public void setUp() throws Exception
{
// 配置webdriver
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability("automationName", "Selendroid");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("deviceName", "192.168.56.101:5555");
capabilities.setCapability("platformVersion", "4.1.1");
capabilities.setCapability("app", "D:\\workspace\\wapjs_client\\apps\\jsmcc.apk");
capabilities.setCapability("appPackage", "com.jsmcc");
capabilities.setCapability("appActivity", ".ui.WelcomeActivity");
// appium的独特地方,使用自己的AppiumDriver, 它本身是继承自WebDriver
driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
appium 报错日志为:
debug: Selendroid server is alive!
debug: Listening for Selendroid logs
debug: Creating Selendroid session
debug: Making http request with opts: {"url":"http://localhost:8080/wd/hub/sessi
on","method":"POST","json":{"desiredCapabilities":{"warnings":{},"desired":{"aut
omationName":"Selendroid","platformVersion":"4.1.1","app":"D:\\workspace\\wapjs_
client\\apps\\jsmcc.apk","platformName":"Android","deviceName":"192.168.56.101:5
555","browserName":"","appActivity":".ui.WelcomeActivity","appPackage":"com.jsmc
c"},"automationName":"Selendroid","platformVersion":"4.1.1","app":"D:\\workspace
\\wapjs_client\\apps\\jsmcc.apk","platformName":"Android","deviceName":"192.168.
56.101:5555","browserName":"","appActivity":".ui.WelcomeActivity","appPackage":"
com.jsmcc"}}}
debug: Successfully started selendroid session
debug: Waiting for pkg "com.jsmcc" and activity ".ui.WelcomeActivity" to be focu
sed
debug: Getting focused package and activity
debug: executing: "F:\android_sdk\sdk\platform-tools\adb.exe" -s 192.168.56.101:
5555 shell "dumpsys window windows"
debug: [SELENDROID] http://localhost:8080/wd/hub/session/5ad873c4-d754-cd01-a387
-42a1aa5de440
debug: Getting focused package and activity
debug: executing: "F:\android_sdk\sdk\platform-tools\adb.exe" -s 192.168.56.101:
5555 shell "dumpsys window windows"
debug: Getting focused package and activity
debug: executing: "F:\android_sdk\sdk\platform-tools\adb.exe" -s 192.168.56.101:
5555 shell "dumpsys window windows"
error: com.jsmcc/.ui.WelcomeActivity never started. Current: com.jsmcc/.ui.Featu
reActivity
debug: Selendroid hasn't started app yet, let's do it manually with adb.startApp
debug: executing: "F:\android_sdk\sdk\platform-tools\adb.exe" -s 192.168.56.101:
5555 shell "am start -S -a android.intent.action.MAIN -c android.intent.category
.LAUNCHER -f 0x10200000 -n com.jsmcc/.ui.WelcomeActivity"
debug: Waiting for pkg "com.jsmcc" and activity ".ui.WelcomeActivity" to be focu
sed
debug: Getting focused package and activity
debug: executing: "F:\android_sdk\sdk\platform-tools\adb.exe" -s 192.168.56.101:
5555 shell "dumpsys window windows"
debug: Getting focused package and activity
debug: executing: "F:\android_sdk\sdk\platform-tools\adb.exe" -s 192.168.56.101:
5555 shell "dumpsys window windows"
debug: Getting focused package and activity
....
error: com.jsmcc/.ui.WelcomeActivity never started. Current: com.android.launche
r/com.android.launcher2.Launcher
debug: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: com.jsmcc/.ui.WelcomeA
ctivity never started. Current: com.android.launcher/com.android.launcher2.Launc
her
debug: Error: com.jsmcc/.ui.WelcomeActivity never started. Current: com.android.
launcher/com.android.launcher2.Launcher
at null.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules
\appium\node_modules\appium-adb\lib\adb.js:1273:12)
at null.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules
\appium\node_modules\appium-adb\lib\adb.js:1218:7)
at C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modul
es\appium-adb\lib\adb.js:162:5
at ChildProcess.exithandler (child_process.js:635:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
debug: Responding to client with error: {"status":33,"value":{"message":"A new s
ession could not be created. (Original error: com.jsmcc/.ui.WelcomeActivity neve
r started. Current: com.android.launcher/com.android.launcher2.Launcher)","origV
alue":"com.jsmcc/.ui.WelcomeActivity never started. Current: com.android.launche
r/com.android.launcher2.Launcher"},"sessionId":null}
有没有谁碰到这样的问题啊?求大神帮助