0

目前我正在开发用于自动化测试的 selenium web 驱动程序。由于我对移动应用程序测试也很感兴趣,所以我遇到了这个 selendroid。所以正在研究如何使用 selendroid 进行自动化测试。我已经安装了 Eclipse ADT 创建了一个虚拟设备和在其中安装了 selendroid-test-app。

我试图启动 selendroid 服务器,但由于找不到命令 aapt 而出现错误。经历了许多解决方法,但没有一个有效。我遵循的程序是:

1) 启动 android 虚拟设备(已安装 selendroid-test 应用程序)
2) 我已将 java 路径设置为 jdk1.6 和 android home 路径为 D:\adt-bundle-windows-x86-20131030\adt-bundle-windows -x86-20131030\sdk
3) 从命令提示符尝试使用以下命令启动 selendroid 服务器:
java -jar selendroid-standalone-0.5.1-with-dependencies.jar -aut selendroid-test-app-0.5.1.apk
4 )在 sdk\tools 文件夹中,我有 aapt.exe 文件,我也将其复制到了 platform-tools 文件夹中。

这是我得到的错误

D:\selendroid>java -jar selendroid-standalone-0.5.1-with-dependencies.jar -aut s elendroid-test-app-0.5.1.apk

Nov 6, 2013 12:25:08 PM io.selendroid.SelendroidLauncher main
INFO: ################# Selendroid #################
Nov 6, 2013 12:25:08 PM io.selendroid.SelendroidLauncher lauchServer
INFO: Starting selendroid-server port 5555
Nov 6, 2013 12:25:08 PM io.selendroid.SelendroidLauncher lauchServer
SEVERE: Selendroid was not able to interact with the Android SDK: Command 'aapt'
was not found inside the Android SDK. Please update to the latest development t
ools and try again.
Nov 6, 2013 12:25:08 PM io.selendroid.SelendroidLauncher lauchServer
SEVERE: Please make sure you have the lastest version with the latest updates in
stalled:
Nov 6, 2013 12:25:08 PM io.selendroid.SelendroidLauncher lauchServer
SEVERE: http://developer.android.com/sdk/index.html
Nov 6, 2013 12:25:08 PM io.selendroid.SelendroidLauncher$1 run
INFO: Shutting down Selendroid standalone

还添加了部分详细日志以供参考

rt.jar]
[Loaded java.lang.Class$MethodArray from C:\Program Files\Java\jre6\lib\rt.jar]
[Loaded sun.misc.ProxyGenerator$MethodInfo from C:\Program Files\Java\jre6\lib\r
t.jar]
[Loaded sun.misc.ProxyGenerator$ConstantPool$Entry from C:\Program Files\Java\jr
e6\lib\rt.jar]
[Loaded sun.misc.ProxyGenerator$ConstantPool$ValueEntry from C:\Program Files\Ja
va\jre6\lib\rt.jar]
[Loaded java.io.DataOutput from shared objects file]
[Loaded java.io.DataOutputStream from shared objects file]
[Loaded sun.misc.ProxyGenerator$ConstantPool$IndirectEntry from C:\Program Files
\Java\jre6\lib\rt.jar]
[Loaded sun.misc.ProxyGenerator$FieldInfo from C:\Program Files\Java\jre6\lib\rt
.jar]
[Loaded sun.misc.ProxyGenerator$PrimitiveTypeInfo from C:\Program Files\Java\jre
6\lib\rt.jar]
[Loaded sun.misc.ProxyGenerator$ExceptionTableEntry from C:\Program Files\Java\j
re6\lib\rt.jar]
[Loaded $Proxy0 by instance of java.lang.reflect.Proxy]
[Loaded java.lang.annotation.Target from C:\Program Files\Java\jre6\lib\rt.jar]
[Loaded java.lang.annotation.ElementType from C:\Program Files\Java\jre6\lib\rt.
jar]
[Loaded java.lang.annotation.Documented from C:\Program Files\Java\jre6\lib\rt.j
ar]
[Loaded $Proxy1 by instance of java.lang.reflect.Proxy]
[Loaded java.util.ListIterator from shared objects file]
[Loaded java.util.AbstractList$ListItr from shared objects file]
[Loaded $Proxy2 by instance of java.lang.reflect.Proxy]
[Loaded $Proxy3 from sun.misc.Launcher$AppClassLoader]
[Loaded java.lang.reflect.UndeclaredThrowableException from C:\Program Files\Jav
a\jre6\lib\rt.jar]
[Loaded com.beust.jcommander.ParametersDelegate from file:/D:/selendroid/selendr
oid-standalone-0.5.1-with-dependencies.jar]
[Loaded com.beust.jcommander.DynamicParameter from file:/D:/selendroid/selendroi
d-standalone-0.5.1-with-dependencies.jar]
[Loaded com.beust.jcommander.WrappedParameter from file:/D:/selendroid/selendroi
d-standalone-0.5.1-with-dependencies.jar]
[Loaded com.beust.jcommander.StringKey from file:/D:/selendroid/selendroid-stand
alone-0.5.1-with-dependencies.jar]
[Loaded com.beust.jcommander.ParameterDescription from file:/D:/selendroid/selen
droid-standalone-0.5.1-with-dependencies.jar]
[Loaded java.lang.AssertionError from C:\Program Files\Java\jre6\lib\rt.jar]
[Loaded com.beust.jcommander.Parameters from file:/D:/selendroid/selendroid-stan
dalone-0.5.1-with-dependencies.jar]
[Loaded java.util.Collections$EmptySet$1 from C:\Program Files\Java\jre6\lib\rt.
jar]
[Loaded com.beust.jcommander.ResourceBundle from file:/D:/selendroid/selendroid-
standalone-0.5.1-with-dependencies.jar]
[Loaded sun.reflect.UnsafeIntegerFieldAccessorImpl from C:\Program Files\Java\jr
e6\lib\rt.jar]
[Loaded sun.reflect.UnsafeLongFieldAccessorImpl from C:\Program Files\Java\jre6\
lib\rt.jar]
[Loaded sun.reflect.UnsafeBooleanFieldAccessorImpl from C:\Program Files\Java\jr
e6\lib\rt.jar]
[Loaded sun.reflect.UnsafeObjectFieldAccessorImpl from shared objects file]
[Loaded com.beust.jcommander.Strings from file:/D:/selendroid/selendroid-standal
one-0.5.1-with-dependencies.jar]
[Loaded com.beust.jcommander.FuzzyMap from file:/D:/selendroid/selendroid-standa
lone-0.5.1-with-dependencies.jar]
[Loaded com.beust.jcommander.IParameterValidator2 from file:/D:/selendroid/selen
droid-standalone-0.5.1-with-dependencies.jar]
[Loaded java.util.LinkedList$ListItr from shared objects file]
[Loaded sun.reflect.generics.repository.AbstractRepository from C:\Program Files
\Java\jre6\lib\rt.jar]
[Loaded sun.reflect.generics.repository.FieldRepository from C:\Program Files\Ja
va\jre6\lib\rt.jar]
[Loaded java.lang.reflect.ParameterizedType from C:\Program Files\Java\jre6\lib\
rt.jar]
[Loaded sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl from C:\Pro
gram Files\Java\jre6\lib\rt.jar]
[Loaded sun.reflect.generics.repository.GenericDeclRepository from C:\Program Fi
les\Java\jre6\lib\rt.jar]
[Loaded sun.reflect.generics.repository.ClassRepository from C:\Program Files\Ja
va\jre6\lib\rt.jar]
[Loaded sun.reflect.generics.tree.FormalTypeParameter from C:\Program Files\Java
\jre6\lib\rt.jar]
[Loaded sun.reflect.generics.tree.TypeVariableSignature from C:\Program Files\Ja
va\jre6\lib\rt.jar]
[Loaded java.lang.IndexOutOfBoundsException from shared objects file]
[Loaded java.lang.ArrayIndexOutOfBoundsException from shared objects file]
[Loaded sun.reflect.generics.tree.Signature from C:\Program Files\Java\jre6\lib\
rt.jar]
[Loaded sun.reflect.generics.tree.ClassSignature from C:\Program Files\Java\jre6
\lib\rt.jar]
[Loaded java.lang.reflect.TypeVariable from C:\Program Files\Java\jre6\lib\rt.ja
r]
[Loaded sun.reflect.generics.reflectiveObjects.LazyReflectiveObjectGenerator fro
m C:\Program Files\Java\jre6\lib\rt.jar]
[Loaded sun.reflect.generics.reflectiveObjects.TypeVariableImpl from C:\Program
Files\Java\jre6\lib\rt.jar]
[Loaded java.util.regex.Pattern from shared objects file]
[Loaded java.util.regex.Pattern$Node from shared objects file]
[Loaded java.util.regex.Pattern$5 from shared objects file]
[Loaded java.util.regex.Pattern$LastNode from shared objects file]
[Loaded java.util.regex.Pattern$GroupHead from shared objects file]
[Loaded java.util.regex.Pattern$CharProperty from shared objects file]
[Loaded java.util.regex.Pattern$BmpCharProperty from shared objects file]
[Loaded java.util.regex.Pattern$Single from shared objects file]
[Loaded java.util.regex.Pattern$SliceNode from shared objects file]
[Loaded java.util.regex.Pattern$Slice from shared objects file]
[Loaded java.util.regex.Pattern$Begin from shared objects file]
[Loaded java.util.regex.Pattern$First from shared objects file]
[Loaded java.util.regex.Pattern$Start from shared objects file]
[Loaded java.util.regex.Pattern$TreeInfo from shared objects file]
[Loaded java.util.regex.MatchResult from shared objects file]
[Loaded java.util.regex.Matcher from shared objects file]
[Loaded java.util.SortedSet from shared objects file]
Nov 6, 2013 12:49:09 PM io.selendroid.SelendroidLauncher lauchServer
INFO: Starting selendroid-server port 5555
[Loaded io.selendroid.server.SelendroidStandaloneServer from file:/D:/selendroid
/selendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded java.net.SocketAddress from shared objects file]
[Loaded java.net.InetSocketAddress from shared objects file]
[Loaded java.util.concurrent.Executor from C:\Program Files\Java\jre6\lib\rt.jar
]
[Loaded io.selendroid.server.ServerDetails from file:/D:/selendroid/selendroid-s
tandalone-0.5.1-with-dependencies.jar]
[Loaded org.webbitserver.HttpHandler from file:/D:/selendroid/selendroid-standal
one-0.5.1-with-dependencies.jar]
[Loaded java.util.concurrent.Executors from C:\Program Files\Java\jre6\lib\rt.ja
r]
[Loaded java.util.concurrent.ExecutorService from C:\Program Files\Java\jre6\lib
\rt.jar]
[Loaded java.util.concurrent.AbstractExecutorService from C:\Program Files\Java\
jre6\lib\rt.jar]
[Loaded java.util.concurrent.ThreadPoolExecutor from C:\Program Files\Java\jre6\
lib\rt.jar]
[Loaded java.util.concurrent.RejectedExecutionHandler from C:\Program Files\Java
\jre6\lib\rt.jar]
[Loaded java.util.concurrent.ThreadPoolExecutor$AbortPolicy from C:\Program File
s\Java\jre6\lib\rt.jar]
[Loaded java.util.concurrent.TimeUnit from C:\Program Files\Java\jre6\lib\rt.jar
]
[Loaded java.util.concurrent.TimeUnit$1 from C:\Program Files\Java\jre6\lib\rt.j
ar]
[Loaded java.util.concurrent.TimeUnit$2 from C:\Program Files\Java\jre6\lib\rt.j
ar]
[Loaded java.util.concurrent.TimeUnit$3 from C:\Program Files\Java\jre6\lib\rt.j
ar]
[Loaded java.util.concurrent.TimeUnit$4 from C:\Program Files\Java\jre6\lib\rt.j
ar]
[Loaded java.util.concurrent.TimeUnit$5 from C:\Program Files\Java\jre6\lib\rt.j
ar]
[Loaded java.util.concurrent.TimeUnit$6 from C:\Program Files\Java\jre6\lib\rt.j
ar]
[Loaded java.util.concurrent.TimeUnit$7 from C:\Program Files\Java\jre6\lib\rt.j
ar]
[Loaded java.util.concurrent.BlockingQueue from C:\Program Files\Java\jre6\lib\r
t.jar]
[Loaded java.util.AbstractQueue from C:\Program Files\Java\jre6\lib\rt.jar]
[Loaded java.util.concurrent.SynchronousQueue from C:\Program Files\Java\jre6\li
b\rt.jar]
[Loaded java.util.concurrent.SynchronousQueue$Transferer from C:\Program Files\J
ava\jre6\lib\rt.jar]
[Loaded java.util.concurrent.SynchronousQueue$TransferStack from C:\Program File
s\Java\jre6\lib\rt.jar]
[Loaded java.util.concurrent.SynchronousQueue$TransferStack$SNode from C:\Progra
m Files\Java\jre6\lib\rt.jar]
[Loaded java.util.concurrent.ThreadFactory from C:\Program Files\Java\jre6\lib\r
t.jar]
[Loaded java.util.concurrent.Executors$DefaultThreadFactory from C:\Program File
s\Java\jre6\lib\rt.jar]
[Loaded java.util.concurrent.locks.Condition from shared objects file]
[Loaded java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject fr
om shared objects file]
[Loaded java.net.InetAddress from shared objects file]
[Loaded java.net.InetAddress$Cache from shared objects file]
[Loaded java.net.InetAddress$Cache$Type from shared objects file]
[Loaded java.net.InetAddressImplFactory from shared objects file]
[Loaded java.net.InetAddressImpl from shared objects file]
[Loaded java.net.Inet6AddressImpl from C:\Program Files\Java\jre6\lib\rt.jar]
[Loaded sun.net.spi.nameservice.NameService from shared objects file]
[Loaded java.net.InetAddress$1 from shared objects file]
[Loaded java.net.Inet4AddressImpl from shared objects file]
[Loaded java.net.Inet4Address from shared objects file]
[Loaded sun.net.util.IPAddressUtil from shared objects file]
[Loaded java.util.SubList from shared objects file]
[Loaded java.util.RandomAccessSubList from shared objects file]
[Loaded java.util.SubList$1 from shared objects file]
[Loaded java.net.URI from shared objects file]
[Loaded java.net.URI$Parser from shared objects file]
[Loaded org.webbitserver.WebServers from file:/D:/selendroid/selendroid-standalo
ne-0.5.1-with-dependencies.jar]
[Loaded org.webbitserver.Endpoint from file:/D:/selendroid/selendroid-standalone
-0.5.1-with-dependencies.jar]
[Loaded org.webbitserver.WebServer from file:/D:/selendroid/selendroid-standalon
e-0.5.1-with-dependencies.jar]
[Loaded org.webbitserver.netty.NettyWebServer from file:/D:/selendroid/selendroi
d-standalone-0.5.1-with-dependencies.jar]
[Loaded java.net.UnknownHostException from shared objects file]
[Loaded java.util.concurrent.Callable from C:\Program Files\Java\jre6\lib\rt.jar
]
[Loaded java.util.concurrent.Future from C:\Program Files\Java\jre6\lib\rt.jar]
[Loaded org.webbitserver.handler.exceptions.PrintStackTraceExceptionHandler from
file:/D:/selendroid/selendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded org.webbitserver.handler.exceptions.SilentExceptionHandler from file:/D:
/selendroid/selendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded org.webbitserver.handler.ServerHeaderHandler from file:/D:/selendroid/se
lendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded org.webbitserver.handler.DateHeaderHandler from file:/D:/selendroid/sele
ndroid-standalone-0.5.1-with-dependencies.jar]
[Loaded io.selendroid.server.model.SelendroidStandaloneDriver from file:/D:/sele
ndroid/selendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded io.selendroid.exceptions.AndroidDeviceException from file:/D:/selendroid
/selendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded io.selendroid.exceptions.ShellCommandException from file:/D:/selendroid/
selendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded io.selendroid.exceptions.SelendroidException from file:/D:/selendroid/se
lendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded io.selendroid.exceptions.SessionNotCreatedException from file:/D:/selend
roid/selendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded io.selendroid.android.AndroidApp from file:/D:/selendroid/selendroid-sta
ndalone-0.5.1-with-dependencies.jar]
[Loaded io.selendroid.android.HardwareDeviceListener from file:/D:/selendroid/se
lendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded io.selendroid.android.DeviceManager from file:/D:/selendroid/selendroid-
standalone-0.5.1-with-dependencies.jar]
[Loaded org.json.JSONException from file:/D:/selendroid/selendroid-standalone-0.
5.1-with-dependencies.jar]
[Loaded io.selendroid.exceptions.DeviceStoreException from file:/D:/selendroid/s
elendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded io.selendroid.builder.SelendroidServerBuilder from file:/D:/selendroid/s
elendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded org.apache.commons.compress.archivers.ArchiveEntry from file:/D:/selendr
oid/selendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded org.apache.commons.compress.archivers.ArchiveOutputStream from file:/D:/
selendroid/selendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream from fi
le:/D:/selendroid/selendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded java.net.JarURLConnection from shared objects file]
[Loaded sun.net.www.protocol.jar.JarURLConnection from shared objects file]
[Loaded sun.net.www.protocol.jar.URLJarFile$URLJarFileCloseController from share
d objects file]
[Loaded sun.net.www.protocol.jar.JarFileFactory from shared objects file]
[Loaded sun.net.www.protocol.jar.URLJarFile from shared objects file]
[Loaded sun.net.www.protocol.jar.URLJarFile$URLJarFileEntry from shared objects
file]
[Loaded sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream from shared
objects file]
[Loaded io.selendroid.android.impl.DefaultAndroidApp from file:/D:/selendroid/se
lendroid-standalone-0.5.1-with-dependencies.jar]
[Loaded org.apache.commons.exec.CommandLine from file:/D:/selendroid/selendroid-
standalone-0.5.1-with-dependencies.jar]
[Loaded io.selendroid.android.AndroidSdk from file:/D:/selendroid/selendroid-sta
ndalone-0.5.1-with-dependencies.jar]
[Loaded java.io.FileFilter from C:\Program Files\Java\jre6\lib\rt.jar]
[Loaded java.lang.ProcessEnvironment from shared objects file]
[Loaded java.lang.ProcessEnvironment$NameComparator from shared objects file]
[Loaded java.lang.ProcessEnvironment$EntryComparator from shared objects file]
[Loaded java.util.Collections$UnmodifiableMap from shared objects file]
[Loaded java.util.SortedMap from shared objects file]
[Loaded java.util.NavigableMap from shared objects file]
[Loaded java.util.TreeMap from shared objects file]
[Loaded java.lang.ProcessEnvironment$CheckedEntrySet from shared objects file]
[Loaded java.lang.ProcessEnvironment$CheckedEntrySet$1 from shared objects file]

[Loaded java.lang.ProcessEnvironment$CheckedEntry from shared objects file]
[Loaded java.util.TreeMap$Entry from shared objects file]
[Loaded io.selendroid.android.AndroidSdk$1 from file:/D:/selendroid/selendroid-s
tandalone-0.5.1-with-dependencies.jar]
Nov 6, 2013 12:49:09 PM io.selendroid.SelendroidLauncher lauchServer
SEVERE: Selendroid was not able to interact with the Android SDK: Command 'aapt'
was not found inside the Android SDK. Please update to the latest development t
ools and try again.
Nov 6, 2013 12:49:09 PM io.selendroid.SelendroidLauncher lauchServer
SEVERE: Please make sure you have the lastest version with the latest updates in
stalled:
Nov 6, 2013 12:49:09 PM io.selendroid.SelendroidLauncher lauchServer
SEVERE: http://developer.android.com/sdk/index.html
[Loaded java.util.IdentityHashMap$KeySet from shared objects file]
[Loaded java.util.IdentityHashMap$IdentityHashMapIterator from shared objects fi
le]
[Loaded java.util.IdentityHashMap$KeyIterator from shared objects file]
Nov 6, 2013 12:49:09 PM `enter code here`io.selendroid.SelendroidLauncher$1 run
INFO: Shutting down Selendroid standalone
[Loaded sun.nio.ch.FileChannelImpl$FileLockTable$Releaser from shared objects fi
le]
[Loaded sun.nio.ch.FileChannelImpl$1 from shared objects file]

操作系统:windows 7 32 位 在 SDK 管理器中我没有找到任何可用的更新

请帮助。挣扎了很多天..

4

4 回答 4

0

Please make sure your JAVA_HOME points to a JDK: http://selendroid.io/setup.html

I recommend to use latest snapshot version (0.6.0-SNAPSHOT), because lately improvements especially for Windows has been added. You find the version here: http://ci.selendroid.io/job/selendroid/io.selendroid$selendroid-standalone/

于 2013-11-18T18:20:51.580 回答
0

我猜系统正在“build-tools”文件夹中寻找“aapt”。尝试从 SDK 管理器安装最新版本的“Andriod SDK Build-tools”。

于 2013-11-20T06:00:16.670 回答
0

查看ANDROID_HOME变量,例如:

ANDROID_HOME=/home/joel/dev/android/android-sdk-linux

这必须存在。

于 2015-12-02T19:17:51.223 回答
0

只需将 aapt.exe 文件从 Android\sdk\build-tools\nn.nn\ 目录(使用最新的)复制到 Android\sdk\platform-tools 目录...

于 2016-10-19T23:27:10.033 回答