uiautomatorviewer环境配置

在unbuntu下配置该环境,需要android-sdk

需要在开机加载的环境中配置;在/etc/profile中添加下面2句

export PATH=/home/lyx/zhenx/android-sdk-linux/platform-tools:$PATH  
export PATH=/home/lyx/zhenx/android-sdk-linux/tools:$PATH

注意:/home/lyx/zhenx/android-sdk-linux/为当前用户下面的android-sdk的绝对路径

第一次打开automatorviewer时经常出现下面的错误

pnp@×××:~$ uiautomatorviewer
04:15:11 E/adb: Cannot run program "/home/pnp/android-sdk-linux/platform-tools/adb": error=2, No such file or directory
Exception in thread "main" java.lang.IllegalArgumentException: java.io.IOException: Cannot run program "/home/pnp/android-sdk-linux/platform-tools/adb": error=2, No such file or directory
    at com.android.ddmlib.AndroidDebugBridge.(AndroidDebugBridge.java:567)
    at com.android.ddmlib.AndroidDebugBridge.createBridge(AndroidDebugBridge.java:323)
    at com.android.uiautomator.DebugBridge.init(DebugBridge.java:68)
    at com.android.uiautomator.UiAutomatorViewer.main(UiAutomatorViewer.java:73)
Caused by: java.io.IOException: Cannot run program "/home/pnp/android-sdk-linux/platform-tools/adb": error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
    at com.android.ddmlib.AndroidDebugBridge$1.run(AndroidDebugBridge.java:625)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.(UNIXProcess.java:187)
    at java.lang.ProcessImpl.start(ProcessImpl.java:130)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
    ... 2 more


解决上面的问题需要安装下面2个库文件

  sudo apt-get install zlib1g:i386
  sudo apt-get install lib32stdc++6


你可能感兴趣的:(Python)