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

fix: isAppInstalled in lib/simulator-xcode-15.js #368

Merged
merged 3 commits into from
Jul 21, 2023
Merged

Conversation

KazuCocoa
Copy link
Member

According to appium/appium#18749 (comment) , probably await this.simctl.getEnv('IPHONE_SIMULATOR_ROOT') included a new line. Then, the built path could have \n.

It might be safe to do trim()

Comment on lines +21 to +26
const infoPlistPath = path.resolve(appRoot, 'Info.plist');
if (!(await fs.exists(infoPlistPath))) {
return '';
}
const {stdout} = await exec('/usr/libexec/PlistBuddy', [
'-c', 'print CFBundleIdentifier', path.resolve(appRoot, 'Info.plist')
'-c', 'print CFBundleIdentifier', infoPlistPath
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no info.plist app existed...

[XCUITestDriver@44d3 (567021d0)] {"stdout":"File Doesn't Exist, Will Create: /Library/Developer/CoreSimulator/Volumes/iOS_21A5277g/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/Applications/TVRemoteUIService.app/Info.plist\n","stderr":"Print: Entry, \"CFBundleIdentifier\", Does Not Exist\n","code":1}
[DevCon Factory] Releasing connections for 63C676EB-2AFF-4EDB-8AD5-D9FD38A27DCB device on any port number
[DevCon Factory] No cached connections have been found
[debug] [XCUITestDriver@44d3 (567021d0)] Not clearing log files. Use `clearSystemFiles` capability to turn on.
[debug] [IOSSimulatorLog] Stopping iOS log capture
[debug] [XCUITestDriver@44d3 (567021d0)] Parsed BUILD_DIR configuration value: '/Users/kazu/Library/Developer/Xcode/DerivedData/WebDriverAgent-bowtbwjhvtmxajftyiaqrygoxash/Build/Products'
[debug] [XCUITestDriver@44d3 (567021d0)] Got derived data root: '/Users/kazu/Library/Developer/Xcode/DerivedData/WebDriverAgent-bowtbwjhvtmxajftyiaqrygoxash'
[debug] [AppiumDriver@d4a4] Event 'newSessionStarted' logged at 1689921783840 (23:43:03 GMT-0700 (Pacific Daylight Time))
[debug] [AppiumDriver@d4a4] Encountered internal error running command: Error: Command '/usr/libexec/PlistBuddy -c 'print CFBundleIdentifier' '/Library/Developer/CoreSimulator/Volumes/iOS_21A5277g/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/Applications/TVRemoteUIService.app/Info.plist'' exited with code 1
[debug] [AppiumDriver@d4a4]     at ChildProcess.<anonymous> (/Users/kazu/.appium/node_modules/appium-xcuitest-driver/node_modules/teen_process/lib/exec.js:128:19)
[debug] [AppiumDriver@d4a4]     at ChildProcess.emit (node:events:527:28)
[debug] [AppiumDriver@d4a4]     at maybeClose (node:internal/child_process:1092:16)
[debug] [AppiumDriver@d4a4]     at Socket.<anonymous> (node:internal/child_process:451:11)
[debug] [AppiumDriver@d4a4]     at Socket.emit (node:events:527:28)
[debug] [AppiumDriver@d4a4]     at Pipe.<anonymous> (node:net:709:12)

@KazuCocoa KazuCocoa changed the title fix: trim new line in getEnv fix: isAppInstalled Jul 21, 2023
@KazuCocoa KazuCocoa changed the title fix: isAppInstalled fix: isAppInstalled in Xcode 15 Jul 21, 2023
@KazuCocoa KazuCocoa changed the title fix: isAppInstalled in Xcode 15 fix: isAppInstalled in lib/simulator-xcode-15.js Jul 21, 2023
@KazuCocoa
Copy link
Member Author

Let's merge this for now to fix user-facing issue. Please change/comment when you come back from vacation @mykola-mokhnach

@KazuCocoa KazuCocoa merged commit 8a749d1 into master Jul 21, 2023
11 checks passed
@KazuCocoa KazuCocoa deleted the KazuCocoa-patch-1 branch July 21, 2023 07:31
github-actions bot pushed a commit that referenced this pull request Jul 21, 2023
## [5.1.2](v5.1.1...v5.1.2) (2023-07-21)

### Bug Fixes

* isAppInstalled in lib/simulator-xcode-15.js ([#368](#368)) ([8a749d1](8a749d1))
@github-actions
Copy link

🎉 This PR is included in version 5.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant