Test recorder fails to install app to physical device

Hi, I used .app for simulator and .ipa for physical device. I successfully managed to record tests on iOS simulator but it gave error when I tried to test on physical device.

I used Debug-iPhone configuration tied with development profile and certificate.

Latest version of VS for Mac
XCode 8.3.3
Xamarin Test Recorder version 1.1.14 (1.0)
iPhone 7plus iOS 10.3.3

Error is;
[03:52:34] Failed to install app to device exit code: 134 with error: 2017-08-02 15:52:33.989 iOSDeviceManager[19026:1192613] * Terminating app due to uncaught exception 'CBXException', reason: 'Error codesigning /var/folders/79/5xrbs4813qdflqrgy0g4cp68x4qq1g/T/tmp595fd9f8.tmp/Payload/MyApp.iOS.app: /var/folders/79/5xrbs4813qdflqrgy0g4cp68x4qq1g/T/tmp595fd9f8.tmp/Payload/MyApp.iOS.app/MyApp.iOS: replacing existing signature
/var/folders/79/5xrbs4813qdflqrgy0g4cp68x4qq1g/T/tmp595fd9f8.tmp/Payload/MyApp.iOS.app/MyApp.iOS: signed app bundle with Mach-O universal (armv7 arm64) [com.myapp.app]
/var/folders/79/5xrbs4813qdflqrgy0g4cp68x4qq1g/T/tmp595fd9f8.tmp/Payload/MyApp.iOS.app: replacing existing signature
'

  • First throw call stack:
    (
    0 CoreFoundation 0x00007fffbe0ee57b __exceptionPreprocess + 171
    1 libobjc.A.dylib 0x00007fffd33471da objc_exception_throw + 48
    2 iOSDeviceManager 0x000000010e579cdd +[Command positionalArgShortFlag:] + 0
    3 iOSDeviceManager 0x000000010e55dc92 +[Codesigner resignBundle:bundleExecutable:appEntitlementsFile:codesignIdentity:] + 477
    4 iOSDeviceManager 0x000000010e55f3eb +[Codesigner resignAppDir:baseDir:provisioningProfile:codesignIdentity:resourcesToInject:] + 3573
    5 iOSDeviceManager 0x000000010e55d147 +[Codesigner resignApplication:withProvisioningProfile:withCodesignIdentity:resourcesToInject:] + 283
    6 iOSDeviceManager 0x000000010e55886e -[PhysicalDevice installApp:mobileProfile:codesignIdentity:resourcesToInject:shouldUpdate:] + 652
    7 iOSDeviceManager 0x000000010e558c65 -[PhysicalDevice installApp:resourcesToInject:shouldUpdate:] + 67
    8 iOSDeviceManager 0x000000010e55b5e8 +[InstallAppCommand execute:] + 873
    9 iOSDeviceManager 0x000000010e57c504 +[CLI process:] + 1062
    10 iOSDeviceManager 0x000000010e549eb1 main + 121
    11 libdyld.dylib 0x00007fffd3c28235 start + 1
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException

I also tested with/without checking injecting calabash option on preferences and added test cloud agent to my project from nuget but no luck. Any help will be appreciated. Thanks!

Posts

  • ShantimohanElchuriShantimohanElchuri USMember ✭✭✭✭✭

    @OnurHazar It says "Error codesigning". Did you generate the certificates and set it in project properties?

  • Kent.GreenKent.Green USXamarin Team Xamurai
    1. Are you able to install and run the IPA on your device independently of running any UITests / Test Recorder?
    2. Did you also initialize the Xamarin Test Cloud agent when you added it to your iOS app project? https://developer.xamarin.com/guides/testcloud/uitest/adding-uitest/#Initialize_the_Xamarin_Test_Cloud_Agent

    Note: If you export the tests you recorded from the iOS simulator, those exported tests will likely still work on a device build of the same app; because the queries would not be changed due to the difference in a device vs. simulator. So it is possible to use tests that were recorded for the simulator against an IPA in either Visual Studio for Mac, locally via the command line, or in the Test Cloud; as long as the IPA is set up properly.

  • OnurHazarOnurHazar USUniversity ✭✭✭

    @ShantimohanElchuri Yes, I am able to deploy to the device from visual studio for mac.
    @KentGreen I tried to initialize but it gives error on Xamarin.Calabash.Start(); I am sure calabash.dll is added. So I removed the package and checked inject calabash option of test recorder. I guess the problem occurs when it tries to resign the app bundle with the existing code sign identity. I go to xcode provisioning profiles path (~/Library/MobileDevice/Provisioning Profiles) and removed the old profiles for the same project (new xcode 8.3 doesn't allow you to manage profiles so I did manually). I downloaded new profiles again and with this attempt, it worked. But sometimes it gives error while resigning. I also tested Xamarin Test Recorder version 1.1.15 version and its same. I am not sure there may be a bug or something of test recorder all in all its a preview product. I agree that it will be quicker if I generate scripts from simulator and put them in my uitest project. Thanks for the tip.

  • Kent.GreenKent.Green USXamarin Team Xamurai

    @OnurHazar What is the error you see on Xamarin.Calabash.Start()?

  • OnurHazarOnurHazar USUniversity ✭✭✭

    @KentGreen When I downloaded test cloud agent from nuget, it didn't see the reference immediately, I closed and reopened VS for mac to get the reference properly.

    "Type of namespace name "Calabash" does not exist in the namespace "Xamarin" (are you missing an assembly reference)

  • lexli95lexli95 CHMember

    I'm facing a similar problem.

    XCode 8.3.3
    Xamarin Test Recorder version 1.2.1 (1.0)
    iPad Air iOS 10.3.3

    As you can see in the recorder log file, there is a problem with the codesign identity on the device although the app is codesigned and has a provisioning profile.

    Any suggestions how I can fix my issue?

    [02:31:27] Injecting calabash into iOS app
    [02:31:27] Installing /var/folders/4v/71l6w2sn05df91djd89zb7q40000gp/T/test-recorder/ios-injection/calabash.dylib
    [02:31:27] Linking calabash.dylib
    [02:31:42] Process: '/var/folders/4v/71l6w2sn05df91djd89zb7q40000gp/T/test-recorder/idm/bin/iOSDeviceManager is-installed com.geberit.setapptest -d c3088158b0676211e3a5156ac2846cec372f94bd' exited with code: 2
    [02:31:54] Process: '/var/folders/4v/71l6w2sn05df91djd89zb7q40000gp/T/test-recorder/idm/bin/iOSDeviceManager install "/var/folders/4v/71l6w2sn05df91djd89zb7q40000gp/T/tmpaed04d3.tmp/Payload/xtr-SetAppiOS.app" -d c3088158b0676211e3a5156ac2846cec372f94bd -i "/Applications/Xamarin Test Recorder.app/Contents/Resources/recorderPluginCalabash.dylib"' exited with code: 134
    [02:31:54] Failed to install app to device exit code: 134 with error: 2017-09-25 14:31:54.940 iOSDeviceManager[42936:518285] *** Terminating app due to uncaught exception 'CBXException', reason: 'Unable to find appropriate codesign identity for device c3088158b0676211e3a5156ac2846cec372f94bd / app com.geberit.setapptest combo'
    *** First throw call stack:
    (
    0 CoreFoundation 0x00007fffc8b932cb __exceptionPreprocess + 171
    1 libobjc.A.dylib 0x00007fffdd9a348d objc_exception_throw + 48
    2 iOSDeviceManager 0x0000000105c7cc7a +[Command resourcesFromArgs:] + 0
    3 iOSDeviceManager 0x0000000105c88251 +[MobileProfile bestMatchProfileForApplication:device:] + 284
    4 iOSDeviceManager 0x0000000105c5a331 -[PhysicalDevice installApp:mobileProfile:codesignIdentity:resourcesToInject:shouldUpdate:] + 551
    5 iOSDeviceManager 0x0000000105c5a71e -[PhysicalDevice installApp:resourcesToInject:shouldUpdate:] + 67
    6 iOSDeviceManager 0x0000000105c5d51f +[InstallAppCommand execute:] + 876
    7 iOSDeviceManager 0x0000000105c7f84d +[CLI process:] + 1063
    8 iOSDeviceManager 0x0000000105c49fc5 main + 121
    9 libdyld.dylib 0x00007fffde289235 start + 1
    10 ??? 0x0000000000000007 0x0 + 7
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException

    [02:31:54] Failed to install app to device
    [02:31:54] Failed to install app to device
    [02:31:54] at Xamarin.TestRecorder.Mac.iOSDeviceManagerService.Install (System.String appPath, System.String deviceId, System.Boolean injectPlugin) [0x0005f] in <89266fd7458141bc8579e46ad3a1a380>:0
    at Xamarin.TestRecorder.Mac.MaciOSDeviceTools.InstallToDevice (System.String appDir, System.String deviceId, System.Boolean injectPlugin) [0x00005] in <89266fd7458141bc8579e46ad3a1a380>:0
    at Xamarin.TestRecorder.Portable.iOS.iOSRecordingSession+d__11.MoveNext () [0x001d2] in <9571b2e365bf4d459f51545898f01bf8>:0

  • lexli95lexli95 CHMember

    I'm facing a similar problem.

    XCode 8.3.3
    Xamarin Test Recorder version 1.2.1 (1.0)
    iPad Air iOS 10.3.3

    As you can see in the recorder log file, there is a problem with the codesign identity on the device although the app is codesigned and has a provisioning profile.

    Any suggestions how I can fix my issue?

    [02:31:27] Injecting calabash into iOS app
    [02:31:27] Installing /var/folders/4v/71l6w2sn05df91djd89zb7q40000gp/T/test-recorder/ios-injection/calabash.dylib
    [02:31:27] Linking calabash.dylib
    [02:31:42] Process: '/var/folders/4v/71l6w2sn05df91djd89zb7q40000gp/T/test-recorder/idm/bin/iOSDeviceManager is-installed com.geberit.setapptest -d c3088158b0676211e3a5156ac2846cec372f94bd' exited with code: 2
    [02:31:54] Process: '/var/folders/4v/71l6w2sn05df91djd89zb7q40000gp/T/test-recorder/idm/bin/iOSDeviceManager install "/var/folders/4v/71l6w2sn05df91djd89zb7q40000gp/T/tmpaed04d3.tmp/Payload/xtr-SetAppiOS.app" -d c3088158b0676211e3a5156ac2846cec372f94bd -i "/Applications/Xamarin Test Recorder.app/Contents/Resources/recorderPluginCalabash.dylib"' exited with code: 134
    [02:31:54] Failed to install app to device exit code: 134 with error: 2017-09-25 14:31:54.940 iOSDeviceManager[42936:518285] *** Terminating app due to uncaught exception 'CBXException', reason: 'Unable to find appropriate codesign identity for device c3088158b0676211e3a5156ac2846cec372f94bd / app com.geberit.setapptest combo'
    *** First throw call stack:
    (
    0 CoreFoundation 0x00007fffc8b932cb __exceptionPreprocess + 171
    1 libobjc.A.dylib 0x00007fffdd9a348d objc_exception_throw + 48
    2 iOSDeviceManager 0x0000000105c7cc7a +[Command resourcesFromArgs:] + 0
    3 iOSDeviceManager 0x0000000105c88251 +[MobileProfile bestMatchProfileForApplication:device:] + 284
    4 iOSDeviceManager 0x0000000105c5a331 -[PhysicalDevice installApp:mobileProfile:codesignIdentity:resourcesToInject:shouldUpdate:] + 551
    5 iOSDeviceManager 0x0000000105c5a71e -[PhysicalDevice installApp:resourcesToInject:shouldUpdate:] + 67
    6 iOSDeviceManager 0x0000000105c5d51f +[InstallAppCommand execute:] + 876
    7 iOSDeviceManager 0x0000000105c7f84d +[CLI process:] + 1063
    8 iOSDeviceManager 0x0000000105c49fc5 main + 121
    9 libdyld.dylib 0x00007fffde289235 start + 1
    10 ??? 0x0000000000000007 0x0 + 7
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException

    [02:31:54] Failed to install app to device
    [02:31:54] Failed to install app to device
    [02:31:54] at Xamarin.TestRecorder.Mac.iOSDeviceManagerService.Install (System.String appPath, System.String deviceId, System.Boolean injectPlugin) [0x0005f] in <89266fd7458141bc8579e46ad3a1a380>:0
    at Xamarin.TestRecorder.Mac.MaciOSDeviceTools.InstallToDevice (System.String appDir, System.String deviceId, System.Boolean injectPlugin) [0x00005] in <89266fd7458141bc8579e46ad3a1a380>:0
    at Xamarin.TestRecorder.Portable.iOS.iOSRecordingSession+d__11.MoveNext () [0x001d2] in <9571b2e365bf4d459f51545898f01bf8>:0

  • I have a similar problem but I'm not even able to deploy to the device.
    I have only just created the solution in VS for mac and selected the Automated UI Test project option

Sign In or Register to comment.