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

Identify when the iOS simulator or SDK hasn't been installed #2099

Open
freakboy3742 opened this issue Jan 3, 2025 · 1 comment
Open

Identify when the iOS simulator or SDK hasn't been installed #2099

freakboy3742 opened this issue Jan 3, 2025 · 1 comment
Labels
bug A crash or error in behavior. iOS The issue relates to Apple iOS mobile support.

Comments

@freakboy3742
Copy link
Member

Describe the bug

Briefcase will detect if Xcode is installed, and if it isn't, direct the user to the App Store to download it.

However, while a fresh Xcode install includes the macOS SDK, it doesn't include the iOS SDK.

Steps to reproduce

  1. On a machine with no prior Xcode install, install Xcode, but don't download the iOS SDK.
  2. Create a new helloworld project
  3. briefcase create iOS

Generates the following error:

           [helloworld] Updating app metadata...                                                                                                                        xcode.py:393
           Setting main module... started                                                                                                                               xcode.py:374
           Setting main module... done                                                                                                                                  xcode.py:374
                                                                                                                                                                        xcode.py:396
           [helloworld] Building Xcode project...                                                                                                                       xcode.py:396
           Building... started                                                                                                                                          xcode.py:397
                                                                                                                                                                   subprocess.py:827
           >>> Running Command:                                                                                                                                    subprocess.py:827
           >>>     xcodebuild build -project '/Users/dyeaw/beeware-tutorial/helloworld/build/helloworld/ios/xcode/Hello World.xcodeproj' -destination              subprocess.py:827
           'platform="iOS Simulator"' -configuration Debug -arch arm64 -sdk iphonesimulator -quiet                                                                                  
           >>> Working Directory:                                                                                                                                  subprocess.py:827
           >>>     /Users/dyeaw/beeware-tutorial/helloworld                                                                                                        subprocess.py:827
[09:55:33] --- xcodebuild: WARNING: Ignoring provided run destination because no scheme was passed.                                                                subprocess.py:195
[09:55:36] /* com.apple.actool.errors */                                                                                                                           subprocess.py:195
           /Users/dyeaw/beeware-tutorial/helloworld/build/helloworld/ios/xcode/HelloWorld/Images.xcassets: error: No available simulator runtimes for platform     subprocess.py:195
           iphonesimulator. SimServiceContext supportedRuntimes=[]                                                                                                                  
           /* com.apple.actool.document.notices */                                                                                                                 subprocess.py:195
           /Users/dyeaw/beeware-tutorial/helloworld/build/helloworld/ios/xcode/HelloWorld/Images.xcassets:./AppIcon.appiconset/[][ipad][76x76][][][1x][][][][]:    subprocess.py:195
           notice: 76x76@1x app icons only apply to iPad apps targeting releases of iOS prior to 10.0.                                                                              
           /* com.apple.actool.compilation-results */                                                                                                              subprocess.py:195
           /Users/dyeaw/beeware-tutorial/helloworld/build/helloworld/ios/xcode/build/Debug-iphonesimulator/Hello World.app/[email protected]                     subprocess.py:195
           /Users/dyeaw/beeware-tutorial/helloworld/build/helloworld/ios/xcode/build/Debug-iphonesimulator/Hello World.app/AppIcon76x76@2x~ipad.png                subprocess.py:195
           /Users/dyeaw/beeware-tutorial/helloworld/build/helloworld/ios/xcode/build/Hello World.build/Debug-iphonesimulator/Hello                                 subprocess.py:195
           World.build/assetcatalog_generated_info.plist                                                                                                                            
                                                                                                                                                                   subprocess.py:195
           note: Run script build phase 'Install target specific Python modules' will be run during every build because the option to run the script phase "Based  subprocess.py:195
           on dependency analysis" is unchecked. (in target 'Hello World' from project 'Hello World')                                                                               
           note: Run script build phase 'Sign Python Binary Modules' will be run during every build because the option to run the script phase "Based on           subprocess.py:195
           dependency analysis" is unchecked. (in target 'Hello World' from project 'Hello World')                                                                                  
           ** BUILD FAILED **       

Expected behavior

Briefcase should, at the very least, detect that there is no iOS runtime available, and prompt the user to install it.

Ideally, it would also start the download of the iOS SDK; but this may not be possible to programmatically trigger.

Screenshots

No response

Environment

  • Operating System: macOS
  • Python version: All
  • Software versions:
    • Briefcase: 0.3.20

Logs

No response

Additional context

See beeware/beeware#458 for the original report/fix to the tutorial.

This is difficult to reproduce because once you have downloaded the iOS SDK, you'll never see this error again.

There might be a similar error when Xcode updates with a new iOS SDK (eg when a new iOS version is released). Downloading the iOS SDK a manual step there, too.

My initial guess is that the best approach will be to run xcrun --show-sdk-path --sdk iphoneos and check for error codes and/or the existence of the returned directory. However, I don't know exactly what this method returns if you don't have an iOS SDK installed.

@freakboy3742 freakboy3742 added bug A crash or error in behavior. iOS The issue relates to Apple iOS mobile support. labels Jan 3, 2025
@freakboy3742
Copy link
Member Author

See also #1616; that covers a number of issues related to first-time launch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. iOS The issue relates to Apple iOS mobile support.
Projects
None yet
Development

No branches or pull requests

1 participant