Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: XCUITest-driver invalid platform detection when ipa have more than 1 bundle #20075

Closed
3 tasks done
roirh opened this issue May 6, 2024 · 3 comments
Closed
3 tasks done
Labels
Bug a problem that needs fixing XCUITest regarding xcuitest driver

Comments

@roirh
Copy link

roirh commented May 6, 2024

Do I have the most recent component updates?

  • I use the most recent available driver/plugin and server versions

Is the component officially supported by the Appium team?

  • I have verified the component repository is present under the Appium organization in GitHub

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have a IOS app packed as an .ipa, than contains 2 bundleId, one for iPhoneOS and another for WatchOS

After the update 7.15 or 7.15.1 in the xcuitest-driver that changed the management of real device .ipas, the detection of the main bundleId is now wrong because it detects the WatchOS app instead of the iPhoneOS:

Appium 2.5.4 - xcuitest-driver: 7.15.1:

[XCUITestDriver@6cbd (34890071)] Determining device to run tests on: udid: 'xxxxxxxxxxxxxx', real device: true
[XCUITestDriver@6cbd (34890071)] Event 'xcodeDetailsRetrieved' logged at 1715019467549 (20:17:47 GMT+0200 (hora de verano de Europa central))
[BaseDriver] Using local app 'xxxxxxxxxxxx.ipa'
[XCUITestDriver@6cbd (34890071)] Event 'appConfigured' logged at 1715019467858 (20:17:47 GMT+0200 (hora de verano de Europa central))
[XCUITest] Checking whether app '/Users/Shared/qamigo-client/apps/RCME-xxxxx.ipa' is actually present on file system
[XCUITest] App is present
[XCUITestDriver@6cbd (34890071)] CFBundleIdentifier: "com.xxxxxxxxxxxx.watchkitapp"
[XCUITestDriver@6cbd (34890071)] Event 'resetStarted' logged at 1715019467866 (20:17:47 GMT+0200 (hora de verano de Europa central))
[XCUITestDriver@6cbd (34890071)] Reset: fullReset not set. Leaving as is
[XCUITestDriver@6cbd (34890071)] Event 'resetComplete' logged at 1715019467866 (20:17:47 GMT+0200 (hora de verano de Europa central))
[XCUITestDriver@6cbd (34890071)] Using WDA path: '/Users/tnf/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent'
[XCUITestDriver@6cbd (34890071)] Using WDA agent: '/Users/tnf/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj'
[XCUITest] Crash reports root '/Users/tnf/Library/Logs/CrashReporter/MobileDevice/xxxxxxi' does not exist. Got nothing to gather.
[XCUITestDriver@6cbd (34890071)] Event 'logCaptureStarted' logged at 1715019467978 (20:17:47 GMT+0200 (hora de verano de Europa central))
[XCUITestDriver@6cbd (34890071)] Setting up real device
[XCUITestDriver@6cbd (34890071)] Verifying application platform
[XCUITestDriver@6cbd (34890071)] CFBundleSupportedPlatforms: ["WatchOS"]
[XCUITestDriver@6cbd (34890071)] {}
[DevCon Factory] Releasing connections for xxxxxx device on any port number
[DevCon Factory] No cached connections have been found
[XCUITestDriver@6cbd (34890071)] Not clearing log files. Use `clearSystemFiles` capability to turn on.
[AppiumDriver@894f] Event 'newSessionStarted' logged at 1715019467986 (20:17:47 GMT+0200 (hora de verano de Europa central))
[AppiumDriver@894f] Encountered internal error running command: Error: Real device architecture is not supported by the com.xxxxxxxxxx.watchkitapp application. Make sure the correct deployment target has been selected for its compilation in Xcode.
[AppiumDriver@894f]     at XCUITestDriver.verifyApplicationPlatform (/Users/tnf/.appium/node_modules/appium-xcuitest-driver/lib/app-utils.js:48:11)
[AppiumDriver@894f]     at XCUITestDriver.installAUT (/Users/tnf/.appium/node_modules/appium-xcuitest-driver/lib/driver.js:1562:5)
[AppiumDriver@894f]     at XCUITestDriver.start (/Users/tnf/.appium/node_modules/appium-xcuitest-driver/lib/driver.js:605:5)
[AppiumDriver@894f]     at XCUITestDriver.createSession (/Users/tnf/.appium/node_modules/appium-xcuitest-driver/lib/driver.js:413:7)
[AppiumDriver@894f]     at AppiumDriver.createSession (/Users/tnf/.npm-global/lib/node_modules/appium/lib/appium.js:717:35)
[HTTP] <-- POST /session 500 469 ms - 930
[HTTP] 

Expected Behavior

Good detection:
Appium 2.5.4 - xcuitest-driver: 7.14.0

[XCUITestDriver@ccd0 (beef4da2)] Event 'xcodeDetailsRetrieved' logged at 1715020352430 (20:32:32 GMT+0200 (hora de verano de Europa central))
[BaseDriver] Using local app 'xxxxxxx.ipa'
[Support] Found 'unzip' at '/usr/bin/unzip'
[XCUITestDriver@ccd0 (beef4da2)] The app 'xxxxxxxxx.ipa' (256.68 MB) has been extracted to '/var/folders/km/qprd538s0j1bh3_g7j7vf8zh0000gn/T/202446-88505-1rp0uw.q9q1l' in 4.920s
[XCUITestDriver@ccd0 (beef4da2)] Approximate decompression speed: 52.17 MB/s
[XCUITestDriver@ccd0 (beef4da2)] Found 2 bundles in '202446-88505-1rp0uw.q9q1l': Payload/xxxxxx.app,Payload/xxxxxxxx.app/Watch/ADAM_ENTWatchOS.app
[XCUITestDriver@ccd0 (beef4da2)] 'Payload/ADAM_ENT_FULL.app' is the resulting application bundle selected from '/var/folders/km/qprd538s0j1bh3_g7j7vf8zh0000gn/T/202446-88505-1rp0uw.q9q1l'
[XCUITestDriver@ccd0 (beef4da2)] Event 'appConfigured' logged at 1715020357814 (20:32:37 GMT+0200 (hora de verano de Europa central))
[XCUITest] Checking whether app '/var/folders/km/qprd538s0j1bh3_g7j7vf8zh0000gn/T/202446-88505-9sgvri.1b52i/xxxxxxx.app' is actually present on file system
[XCUITest] App is present
[XCUITest] Getting bundle ID from app '/var/folders/km/qprd538s0j1bh3_g7j7vf8zh0000gn/T/202446-88505-9sgvri.1b52i/xxxxx.app': 'com.xxxxxxxxxx'
[XCUITestDriver@ccd0 (beef4da2)] Event 'resetStarted' logged at 1715020357816 (20:32:37 GMT+0200 (hora de verano de Europa central))
[XCUITestDriver@ccd0 (beef4da2)] Reset: fullReset not set. Leaving as is
[XCUITestDriver@ccd0 (beef4da2)] Event 'resetComplete' logged at 1715020357816 (20:32:37 GMT+0200 (hora de verano de Europa central))
[XCUITestDriver@ccd0 (beef4da2)] Using WDA path: '/Users/xxx/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent'
[XCUITestDriver@ccd0 (beef4da2)] Using WDA agent: '/Users/xxx/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj'
[XCUITest] Crash reports root '/Users/tnf/Library/Logs/CrashReporter/MobileDevice/iPhone de Roi' does not exist. Got nothing to gather.
[XCUITestDriver@ccd0 (beef4da2)] Event 'logCaptureStarted' logged at 1715020357961 (20:32:37 GMT+0200 (hora de verano de Europa central))
[XCUITestDriver@ccd0 (beef4da2)] Setting up real device
[XCUITest] Verifying application platform
[XCUITest] CFBundleSupportedPlatforms: ["iPhoneOS"]
[XCUITestDriver@ccd0 (beef4da2)] App 'com.xxxxxxx' is already installed
[XCUITestDriver@ccd0 (beef4da2)] noReset is requested. The app will not be be (re)installed
[XCUITestDriver@ccd0 (beef4da2)] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[DevCon Factory] Requesting connection for device xxxxxx on local port 8100, device port 8100
[DevCon Factory] Cached connections count: 0
[DevCon Factory] Successfully requested the connection for xxxxxxx:8100
[XCUITestDriver@ccd0 (beef4da2)] Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver'
[WD Proxy] Matched '/status' to command name 'getStatus'


Minimal Reproducible Example

#install appium driver with bug
appium driver install xcuitest@7.15.1
#open appium
appium
#launch session with ipa that have 2 bundleId

{
  "appium:udid": "xxxxxx",
  "platformName": "iOS",
  "appium:automationName": "XCUITest",
  "appium:platformVersion": "16.7",
  "appium:app": "ipa_with_2_bundleIds.ipa",
}

Environment

  • Operating system: MAC OS
  • Appium server version (output of appium --version): 2.5.4
  • Appium driver(s) and their version(s): xcuitest-driver 7.15.1 (BUG); 7.14.0 (OK)
  • Appium plugin(s) and their version(s):
  • Node.js version (output of node --version):
  • npm version (output of npm --version):
  • Last component(s) version which did not exhibit the problem:
  • Platform and version under test:
  • Real device or emulator/simulator:

Link to Appium Logs

No response

Further Information

No response

@roirh roirh added Bug a problem that needs fixing Needs Triage bugs which are not yet confirmed labels May 6, 2024
@mykola-mokhnach mykola-mokhnach added XCUITest regarding xcuitest driver and removed Needs Triage bugs which are not yet confirmed labels May 6, 2024
@mykola-mokhnach
Copy link
Collaborator

thanks for the detailed bug report. It should be addressed by appium/appium-xcuitest-driver#2394

@mykola-mokhnach
Copy link
Collaborator

the patch has been published in the driver version 7.15.2

@roirh
Copy link
Author

roirh commented May 7, 2024

the patch has been published in the driver version 7.15.2

Thank you, I've just tried and it works again.

@roirh roirh closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug a problem that needs fixing XCUITest regarding xcuitest driver
Projects
None yet
Development

No branches or pull requests

2 participants