1. ipsw.me에서 기종 + 버전 선택 후 다운로드

2.

맥 : https://github.com/blacktop/ipsw 다운로드 

우분투(wsl에서 실행 불가) : sudo snap install ipsw 

우분투 : apfs-fuse  다운로드

apfs-fuse
0.44MB

./ipsw extract -d iPhone13,1_15.6.1_19G82_Restore.ipsw

3. https://github.com/keith/dyld-shared-cache-extractor 다운로드 후 make

mac용 다운로드

extractor
0.03MB

4. dyld_shared_cache_arm64e 추출

./extractor dyld_shared_cache_arm64e ~/bin

'iOS' 카테고리의 다른 글

[iOS] C++, Objective C, Swift 상호 함수 호출  (0) 2022.10.18

https://android.googlesource.com/toolchain/llvm_android/+/master/README.md 참조하였음.

How to build in linux (or WSL for windows) 

윈도우를 위한 빌드 환경이 없으므로 wsl을 설치한다.

1. install curl & repo & python3

$ sudo apt install python3
$ sudo apt install python-is-python3
$ sudo apt install curl
$ curl https://storage.googleapis.com/git-repo-downloads/repo > repo
$ chmod 755 repo
$ cp repo ~

2. download and extract android-ndk-r25b-linux.zip

3. repo and build it

(If you want to build for windows, --no-build=linux is required.)

$ repo init -u https://android.googlesource.com/platform/manifest -b llvm-toolchain
$ cp android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/manifest_8490178.xml .repo/manifests
$ repo init -m manifest_8490178.xml
$ repo sync -c
$ python toolchain/llvm_android/build.py --no-build=linux

 

Apply to Visual Studio

1. cd C:\Microsoft\AndroidNDK

2. rename the directory on android-ndk-rXXX to android-ndk-rXXX_org

3. download & extract android-ndk-r25b-windows.zip and rename the directory android-ndk-r25b to android-ndk-rXXX

 

Swift에서 Objective C 호출

설정 : Build Settings -> Swift Compiler - General -> Objective-C Bridging Header 에서 헤더 설정 (보통 mm 파일 생성 시 자동 생성 됨)

// MyProject-Bridging-Header.h
#include "MyObjectiveC.h"

// MyObjectiveC.h
@interface MyObjectiveC : NSObject
-(void)Hello
@end

// MyObjectiveC.mm
@import "MyObjectiveC.h"

@implementation MyObjectiveC
-(void)Hello
{
	// do something
}

// MySwift.swift
class Test
{
	func hello()
	{
		MyObjectiveC().Hello()
	}
}

 

Objective C에서 Swift 호출

설정 : Build Settings -> Packaging -> Defines Module : Yes ( -Swift.h가 자동 생성됨)

// MyObjectiveC.mm
#import "MyProject-Swift.h"

void Test()
{
	[[MySwift shared] Hello];
}


// MySwift.swift
#import Foundation

@objc class MySwift : NSObject {
	@objc static let shared = MySwift()
    @objc func Hello()
    {
    	print("hello world");
    }
}

 

Objective C에서 C++ 호출

// Test.hpp
#pragma once

class Test
{
public:
    Test();
    void Hello();
}

void CStyle();


// Test.cpp
Test::Test()
{
}
void Test::Hello()
{
	printf("hello");
}
void CStyle()
{
	printf("C");
}

// MyObjectiveC.mm
#import "Test.hpp"

@implementation MyObjectiveC

-(void)start
{
	CStyle();
	Test test;
	test.Hello();
}

 

C++에서 Objective C호출

// MyCpp.cpp
#include "MyObjectiveC.h"
void func()
{
	Hello();
}

// MyObjectiveC.h
#pragma once

void Hello();

// MyObjectiveC.mm

void Hello()
{
	// do something..
}

 

'iOS' 카테고리의 다른 글

[iOS] 시스템 라이브러리 추출  (0) 2022.12.09

+ Recent posts