Skip to content

YoungHaKim7/Swift_Lang

Repository files navigation


Swift - Getting-started(Linux 도 된다) 좋네 굿

https://www.swift.org/getting-started/

init

swift package init --name MyCLIAdd --type executable
  • run
swift run

or

swift run MyCLIAdd


Xcode

  • macOS
$ swift --version

swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0

Swift (Visual Studio Code)

https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang

iPhone App(Code Swift)


Visual Studio Code Dev Containers

https://github.com/swift-server/vscode-swift/blob/main/docs/remote-dev.md

Swift Playground (repl 활용)

Swift_Lang



.gitignore (Swift)

# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift ####
.DS_Store
/.build
/Packages
xcuserdata/
DerivedData/
.swiftpm/configuration/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
#####
# Swift Package Manager
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
#
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

3. OSX-KVM(macOS 가상환경 설치 LinuxOS에서 함)

https://github.com/kholia/OSX-KVM

4. Darling

First, we’ll download the necessary dependencies for our Linux distro. For example, let’s download and install what’s required on Ubuntu:

$ sudo apt-get install cmake clang bison flex xz-utils libfuse-dev libudev-dev pkg-config \
libc6-dev:i386 linux-headers-generic gcc-multilib libcap2-bin libcairo2-dev libgl1-mesa-dev \
libtiff5-dev libfreetype6-dev libfreetype6-dev:i386 git libelf-dev libxml2-dev libegl1-mesa-dev \
libfontconfig1-dev libbsd-dev

Next, let’s clone the Darling git repository to our local machine:

$ git clone --recursive https://github.com/darlinghq/darling.git

Then, we’ll change into the Darling clone directory:

$ cd darling

Now, let’s make a build directory for the build process:

$ mkdir build && cd build

Inside the build directory, we configure the build with CMake:

$ cmake ..

Now, let’s build Darling with make:

$ make

Importantly, the actual build process can take up to an hour, depending on the resources of our machine.

Finally, we’ll install Darling, build the Darling kernel module, and install darling_mach:

Including component: iokitd
Found Python 2; enabling pre-compilation of Python bytecode
Found required libraries; building with Metal support
-- Found dsymutil: /home/gyoung/Utilities/clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04/bin/dsymutil
-- Compiler include path detected as /home/gyoung/Utilities/clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04/lib/clang/17/include/
-- Checking for module 'libavcodec'
--   Package 'libavcodec', required by 'virtual:world', not found
-- Checking for module 'libavformat'
--   Package 'libavformat', required by 'virtual:world', not found
-- Checking for module 'libavutil'
--   Package 'libavutil', required by 'virtual:world', not found
CMake Error at cmake/FindFFmpeg.cmake:86 (message):
  Could not find libavcodec or libavformat or libavutil
Call Stack (most recent call first):
  src/CoreAudio/CMakeLists.txt:10 (find_package)
[/Volumes/SystemRoot/usr/local/bin]$

[/Volumes/DarlingEmulatedDrive/Users/gyoung]

//
usr/local/bin/darling

// 가상환경 시작
./darling shell

// 가상환경 종료
./darling shutdown

4.1. Install QEMU and KVM

  • To demonstrate, we’ll use the macOS-Simple-KVM project to set up a simple macOS VM in QEMU/KVM setup. For this setup, the Linux system must have:

https://www.baeldung.com/linux/xcode

https://manpages.ubuntu.com/manpages/xenial/man1/qemu-img.1.html

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages