友 以下是appium错误日志:可以帮我解决这个问题吗
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.demo"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
package demolaunchtest;
import static org.junit.Assert.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.android.AndroidDriver;
public class helloTest {
public static AndroidDriver driver;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
File appDir = new File ("Computer\\Lokesh Gangaiah\\Phone\\Download");
File app = new File (appDir,"selendroid-test-app-0.17.0.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("browserName", "");
//capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("deviceName", "Lokesh Gangaiah");
capabilities.setCapability("platformVersion", "5.0");
capabilities.setCapability("device", "Android");
capabilities.setCapability("app",app.getAbsolutePath());
capabilities.setCapability("appPackage", "io.selendroid.testapp");
capabilities.setCapability("appActivity", "io.selendroid.testapp.HomeScreenActivity");
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@Test
public void test() {
System.out.println("Hello");
// fail("Not yet implemented");
}
}
=
info:[debug]清理appium会话 错误:无法启动Appium会话,错误是:错误:hasInternetPermissionFromManifest失败。错误:命令失败:C:\ Windows \ system32 \ cmd.exe / s / c“C:\ Users \ GangaiahL \ AppData \ Local \ Android \ sdk \ build-tools \ 23.0.1 \ aapt.exe dump badging” 错误:未指定转储文件
info:[debug]错误:hasInternetPermissionFromManifest失败。错误:命令失败:C:\ Windows \ system32 \ cmd.exe / s / c“C:\ Users \ GangaiahL \ AppData \ Local \ Android \ sdk \ build-tools \ 23.0.1 \ aapt.exe dump badging” 错误:未指定转储文件
at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:1664:19 at ChildProcess.exithandler (child_process.js:758:5) at ChildProcess.emit (events.js:110:17) at maybeClose (child_process.js:1016:16) at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
info:[debug]响应客户端错误:{“status”:33,“value”:{“message”:“无法创建新会话。(原始错误:hasInternetPermissionFromManifest失败。错误:命令失败:C:\ Windows \ system32 \ cmd.exe / s / c \“C:\ Users \ GangaiahL \ \ AppData \ Local \ Android \ sdk \ build-tools \ 23.0.1 \ aapt.exe dump badging \”\ nERROR :没有指定转储文件\ r \ n)“,”origValue“:”hasInternetPermissionFromManifest失败。错误:命令失败:C:\\ Windows \ system32 \ cmd.exe / s / c \“C:\ Users \ GangaiahL \ AppData \ Local \ Android \ sdk \ build- tools \ 23.0.1 \ aapt.exe dump badging \“\ nERROR:没有指定转储文件\ r \ n”},“sessionId”:null} 信息:&lt; - POST / wd / hub / session 500 568.702 ms - 594
info:[debug]响应客户端错误:{“status”:33,“value”:{“message”:“无法创建新会话。(原始错误:hasInternetPermissionFromManifest失败。错误:命令失败:C:\ Windows \ system32 \ cmd.exe / s / c \“C:\ Users \ GangaiahL \ AppData \ Local \ Android \ sdk \ build-tools \ 23.0.1 \ aapt.exe dump badging \”\ nERROR:没有指定转储文件\ r \ n)“,”origValue“:”hasInternetPermissionFromManifest失败。错误:命令失败:C:\ Windows \ system32 \ cmd.exe / s / c \“C:\ Users \ GangaiahL \ AppData \ Local \ Android \ sdk \ build-tools \ 23.0.1 \ aapt.exe转储标记\“\ nERROR:没有指定转储文件\ r \ n”},“sessionId”:null} info:&lt; - POST / wd / hub / session 500 566.022 ms - 594
答案 0 :(得分:0)
##Error 1:
By seeing your java code, I see this line is the problem:
capabilities.setCapability("app","app.getAbsolutePath()");
If app is a variable then it should be without quotes like:
capabilities.setCapability("app",app.getAbsolutePath());
Because of this appium can't find the app file to dump.
## Error 2:
Change these:
File appDir = new File ("Computer\\Lokesh Gangaiah\\Phone\\Download");
File app = new File (appDir,"selendroid-test-app-0.17.0.apk");
to:
File app = new File ("Computer\\Lokesh Gangaiah\\Phone\\Download\\selendroid-test-app-0.17.0.apk");
And make sure you have apk file at this location.