ios-driver / libimobiledevice-wrapper

35 stars 16 forks source link

Unable to load library 'imobiledevice-sdk' #7

Open ajithvl opened 10 years ago

ajithvl commented 10 years ago

Hi, when i try to run a instruments test on Mac i am getting the following error,

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'imobiledevice-sdk': Native library (darwin/libimobiledevice-sdk.dylib) not found in resource path ([file:/Users/avarakukalayil/Documents/experiment/libimobiledevice-wrapper/target/classes/, file:/Users/avarakukalayil/.m2/repository/net/java/dev/jna/jna/4.0.0/jna-4.0.0.jar, file:/Users/avarakukalayil/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar, file:/Users/avarakukalayil/.m2/repository/com/googlecode/plist/dd-plist/1.3/dd-plist-1.3.jar]) at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:337) at org.libimobiledevice.ios.driver.binding.raw.ImobiledeviceSdkLibrary.(ImobiledeviceSdkLibrary.java:37) at org.libimobiledevice.ios.driver.binding.sdk.IDeviceSDK.(IDeviceSDK.java:40) at test.Test.main(Test.java:37)

Please let me know how to run libimobiledevice instruments.

Thanks, -Ajith

hoihrig commented 9 years ago

you have to run:

JNAInit.init();

before using any of the functions provided by libimobiledevice-wrapper. At least that worked for me.

AlexJinsin commented 7 years ago

@hoihrig I clone git project and import maven project;Then I run test,It can not work; code: `public class Test {

public static void main(String[] args)  {

    JNAInit.init();

    try {
        IOSDevice device = DeviceService.get("f602f0ae61f9b684330d42ac9b9d4fb35e086638");

// AppContainerService appContainerService = new AppContainerService(DeviceService.get("f602f0ae61f9b684330d42ac9b9d4fb35e086638")); } catch (SDKException e) { // TODO Auto-generated catch block e.printStackTrace(); } // InformationService service = new InformationService(device); // System.out.println(service.getDeviceName());

}

} logs: org.libimobiledevice.ios.driver.binding.exceptions.SDKException: SDK_E_LOCKDOWN_CONNECT_FAILED : null at org.libimobiledevice.ios.driver.binding.exceptions.SDKErrorCode.throwIfNeeded(SDKErrorCode.java:55) at org.libimobiledevice.ios.driver.binding.services.IOSDevice.(IOSDevice.java:44) at org.libimobiledevice.ios.driver.binding.services.DeviceService.get(DeviceService.java:37) at com.wuba.ios.infon.test.Test.main(Test.java:17) `