@zsukim/ctv-run 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -11
- package/dist/platforms/tizen.js +17 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,6 +86,8 @@
|
|
|
86
86
|
| `url` | | TV가 로드할 URL |
|
|
87
87
|
| `port` | | TV가 로드할 URL의 포트 |
|
|
88
88
|
| `appId` | | Tizen 앱 고유 ID (없으면 자동 생성) |
|
|
89
|
+
| `tizenPath` | | tizen CLI 실행 경로 (기본값: `tizen`) |
|
|
90
|
+
| `sdbPath` | | sdb 실행 경로 (기본값: `sdb`) |
|
|
89
91
|
|
|
90
92
|
**WebOS**
|
|
91
93
|
|
|
@@ -153,7 +155,11 @@ if (!intentUrl.isNullOrEmpty()) {
|
|
|
153
155
|
|
|
154
156
|
### Tizen
|
|
155
157
|
|
|
156
|
-
[Tizen Studio](https://
|
|
158
|
+
[Tizen Studio](https://docs.tizen.org/application/tizen-studio/setup/install-sdk/) 설치 후 PATH를 설정하거나, `ctv.config.json`에 경로를 직접 지정합니다.
|
|
159
|
+
|
|
160
|
+
> `tizen` CLI와 `sdb`는 Tizen Studio에 포함되어 있습니다. 별도 설치는 필요하지 않습니다.
|
|
161
|
+
|
|
162
|
+
**방법 1 — PATH 설정**
|
|
157
163
|
|
|
158
164
|
```bash
|
|
159
165
|
# ~/.zshrc 또는 ~/.bash_profile
|
|
@@ -163,24 +169,26 @@ export PATH="$PATH:$TIZEN_STUDIO_HOME/tools/ide/bin:$TIZEN_STUDIO_HOME/tools"
|
|
|
163
169
|
|
|
164
170
|
```bash
|
|
165
171
|
source ~/.zshrc
|
|
172
|
+
```
|
|
166
173
|
|
|
167
|
-
|
|
168
|
-
|
|
174
|
+
**방법 2 — ctv.config.json에 경로 지정**
|
|
175
|
+
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"tizen": {
|
|
179
|
+
"tizenPath": "/home/user/tizen-studio/tools/ide/bin/tizen",
|
|
180
|
+
"sdbPath": "/home/user/tizen-studio/tools/sdb"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
169
183
|
```
|
|
170
184
|
|
|
171
185
|
인증서 프로필이 없으면 첫 실행 시 자동으로 생성합니다.
|
|
172
186
|
|
|
173
187
|
### WebOS
|
|
174
188
|
|
|
175
|
-
[LG webOS
|
|
189
|
+
[LG webOS CLI](https://webostv.developer.lge.com/develop/tools/cli-installation) 설치 후 `ares` 명령어를 사용할 수 있습니다.
|
|
176
190
|
|
|
177
|
-
|
|
178
|
-
# 기기 등록 (최초 1회)
|
|
179
|
-
ares-setup-device
|
|
180
|
-
|
|
181
|
-
# 등록 확인
|
|
182
|
-
ares-setup-device --list
|
|
183
|
-
```
|
|
191
|
+
기기 등록은 `ctv-run webos` 첫 실행 시 자동으로 안내됩니다. 등록된 기기가 없으면 `ares-setup-device`를 대신 실행해줍니다.
|
|
184
192
|
|
|
185
193
|
---
|
|
186
194
|
|
package/dist/platforms/tizen.js
CHANGED
|
@@ -21,7 +21,7 @@ const ip_1 = require("../utils/ip");
|
|
|
21
21
|
const platform_1 = require("../utils/platform");
|
|
22
22
|
function runTizen() {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
var _a, _b, _c, _d, _e;
|
|
24
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
25
25
|
const config = (0, config_1.loadConfig)();
|
|
26
26
|
const args = process.argv.slice(2);
|
|
27
27
|
const getArg = (0, platform_1.makeArgParser)(args);
|
|
@@ -30,11 +30,13 @@ function runTizen() {
|
|
|
30
30
|
console.error('\n❌ Tizen TV IP 주소가 필요합니다! (예: --ip=192.168.x.x)');
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
+
const tizenBin = getArg('tizenPath') || ((_b = config.tizen) === null || _b === void 0 ? void 0 : _b.tizenPath) || 'tizen';
|
|
34
|
+
const sdbBin = getArg('sdbPath') || ((_c = config.tizen) === null || _c === void 0 ? void 0 : _c.sdbPath) || 'sdb';
|
|
33
35
|
const targetArg = getArg('target');
|
|
34
36
|
const isLiveMode = !targetArg;
|
|
35
|
-
const port = getArg('port') || ((
|
|
37
|
+
const port = getArg('port') || ((_d = config.tizen) === null || _d === void 0 ? void 0 : _d.port) || ((_e = config.common) === null || _e === void 0 ? void 0 : _e.devServerPort) || 3000;
|
|
36
38
|
const appUrl = getArg('url') ||
|
|
37
|
-
((
|
|
39
|
+
((_f = config.tizen) === null || _f === void 0 ? void 0 : _f.url) ||
|
|
38
40
|
`http://${(0, ip_1.getLocalIp)()}:${port}`;
|
|
39
41
|
const tempAppDir = path_1.default.resolve(process.cwd(), '.ctv-run-tizen');
|
|
40
42
|
if (fs_extra_1.default.existsSync(tempAppDir))
|
|
@@ -68,7 +70,7 @@ function runTizen() {
|
|
|
68
70
|
xmlInfo = getInfoFromXml(process.cwd());
|
|
69
71
|
const appId = getArg('appId') ||
|
|
70
72
|
(xmlInfo === null || xmlInfo === void 0 ? void 0 : xmlInfo.appId) ||
|
|
71
|
-
((
|
|
73
|
+
((_g = config.tizen) === null || _g === void 0 ? void 0 : _g.appId) ||
|
|
72
74
|
'A123456789.CtvRunApp';
|
|
73
75
|
const safeAppName = ((xmlInfo === null || xmlInfo === void 0 ? void 0 : xmlInfo.appName) || 'CtvRunApp').replace(/\s+/g, '');
|
|
74
76
|
// config.xml 없으면 생성
|
|
@@ -77,7 +79,7 @@ function runTizen() {
|
|
|
77
79
|
console.log('\n🎫 Tizen 인증서 프로필 확인 중...');
|
|
78
80
|
const getActive = () => {
|
|
79
81
|
try {
|
|
80
|
-
const list = (0, child_process_1.execSync)(
|
|
82
|
+
const list = (0, child_process_1.execSync)(`${tizenBin} security-profiles list`, {
|
|
81
83
|
encoding: 'utf8',
|
|
82
84
|
});
|
|
83
85
|
const match = list.match(/Active Profile\s*:\s*(\S+)/);
|
|
@@ -108,23 +110,23 @@ function runTizen() {
|
|
|
108
110
|
}
|
|
109
111
|
else {
|
|
110
112
|
p12Pwd = askQuestion('🔑 새로 만들 인증서 비밀번호(4자 이상): ');
|
|
111
|
-
(0, child_process_1.execSync)(
|
|
113
|
+
(0, child_process_1.execSync)(`${tizenBin} certificate -a "${certFileName}" -p "${p12Pwd}" -f "${certFileName}"`, { stdio: 'inherit' });
|
|
112
114
|
}
|
|
113
115
|
try {
|
|
114
|
-
(0, child_process_1.execSync)(
|
|
116
|
+
(0, child_process_1.execSync)(`${tizenBin} security-profiles remove -n "${profileName}"`, {
|
|
115
117
|
stdio: 'ignore',
|
|
116
118
|
});
|
|
117
119
|
}
|
|
118
120
|
catch (e) { }
|
|
119
|
-
(0, child_process_1.execSync)(
|
|
120
|
-
(0, child_process_1.execSync)(
|
|
121
|
+
(0, child_process_1.execSync)(`${tizenBin} security-profiles add -n "${profileName}" -a "${p12Path}" -p "${p12Pwd}"`, { stdio: 'inherit' });
|
|
122
|
+
(0, child_process_1.execSync)(`${tizenBin} security-profiles set-active -n "${profileName}"`, {
|
|
121
123
|
stdio: 'inherit',
|
|
122
124
|
});
|
|
123
125
|
activeProfile = getActive();
|
|
124
126
|
}
|
|
125
127
|
// 패키징
|
|
126
128
|
console.log(`\n🔨 [${activeProfile}] 프로필로 패키징 중...`);
|
|
127
|
-
(0, child_process_1.execSync)(
|
|
129
|
+
(0, child_process_1.execSync)(`${tizenBin} package -t wgt -s "${activeProfile}" -o "${tempAppDir}" -- "${tempAppDir}"`, { stdio: 'inherit' });
|
|
128
130
|
const files = fs_extra_1.default.readdirSync(tempAppDir);
|
|
129
131
|
const generatedWgt = files.find((f) => f.endsWith('.wgt'));
|
|
130
132
|
if (!generatedWgt)
|
|
@@ -133,12 +135,12 @@ function runTizen() {
|
|
|
133
135
|
// TV 연결 및 설치
|
|
134
136
|
console.log(`\n📡 TV 연결 시도: ${tvIp}`);
|
|
135
137
|
try {
|
|
136
|
-
(0, child_process_1.execSync)(
|
|
138
|
+
(0, child_process_1.execSync)(`${sdbBin} connect ${tvIp}`, { stdio: 'ignore' });
|
|
137
139
|
}
|
|
138
140
|
catch (e) { }
|
|
139
141
|
console.log(`📦 앱 설치 중: ${generatedWgt}`);
|
|
140
142
|
try {
|
|
141
|
-
(0, child_process_1.execSync)(
|
|
143
|
+
(0, child_process_1.execSync)(`${tizenBin} install -n "${wgtPath}"`, { stdio: 'inherit' });
|
|
142
144
|
}
|
|
143
145
|
catch (err) {
|
|
144
146
|
console.log('\n⚠️ 설치 실패! (인증서 불일치 가능성이 있습니다.)');
|
|
@@ -151,9 +153,9 @@ function runTizen() {
|
|
|
151
153
|
const answer = askQuestion('❓ 기존 앱을 삭제하고 다시 설치할까요? (Y/n): ');
|
|
152
154
|
if (answer === 'Y') {
|
|
153
155
|
console.log(`🗑️ 기존 앱 삭제 중: ${appId}`);
|
|
154
|
-
(0, child_process_1.execSync)(
|
|
156
|
+
(0, child_process_1.execSync)(`${tizenBin} uninstall -p ${appId}`, { stdio: 'inherit' });
|
|
155
157
|
console.log('✅ 삭제 완료. 재설치 시도...');
|
|
156
|
-
(0, child_process_1.execSync)(
|
|
158
|
+
(0, child_process_1.execSync)(`${tizenBin} install -n "${wgtPath}"`, { stdio: 'inherit' });
|
|
157
159
|
}
|
|
158
160
|
else {
|
|
159
161
|
console.log('🚫 설치 중단.');
|
|
@@ -162,7 +164,7 @@ function runTizen() {
|
|
|
162
164
|
}
|
|
163
165
|
// 앱 실행
|
|
164
166
|
console.log(`🚀 앱 실행 중: ${appId}`);
|
|
165
|
-
(0, child_process_1.execSync)(
|
|
167
|
+
(0, child_process_1.execSync)(`${tizenBin} run -p ${appId}`, { stdio: 'inherit' });
|
|
166
168
|
console.log(`\n✅ 모든 과정 완료!`);
|
|
167
169
|
}
|
|
168
170
|
catch (err) {
|