출처

Native Script 설치

설치 방법은 이전 문서를 참고

프로젝트 초기화

1
ns create app-name --vue --ts

사용 가능한 가상 디바이스 목록 확인

1
tns device android --available-devices
1
2
3
4
5
6
7
8
9
Available emulators
┌───────────────────────────┬──────────┬───────────┬───────────────────┬───────────────────────────┬────────────┐
│ Device Name │ Platform │ Version │ Device Identifier │ Image Identifier │ Error Help │
│ Pixel_3a_API_32_arm64-v8a │ Android │ │ │ Pixel_3a_API_32_arm64-v8a │ │
└───────────────────────────┴──────────┴───────────┴───────────────────┴───────────────────────────┴────────────┘

Connected devices & emulators
Searching for devices...
Cannot find connected devices. Reconnect any connected devices, verify that your system recognizes them, and run this command again.

가상 디바이스에서 실행하려면 하나 이상의 가상 디바이스가 설치되어 있어야한다.

가상 디바이스는 안드로이드 스튜디오에서 설치할 수 있다.

가상 디바이스 실행

https://i.ibb.co/LddW0yX/2022-02-02-8-54-50.png

https://i.ibb.co/5YgBHCj/2022-02-02-8-55-08.png

앱 실행

1
2
3
4
cd app-name

// run on Android
ns run android

빌드하고자 하는 환경으로 세팅 해줘야 정상적으로 실행된다. (링크)

에러 해결

출처

Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.

1
cd ~/Library/Android/sdk/build-tools/31.0.0 && mv d8 dx && cd lib && mv d8.jar dx.jar

성공

NativeScript