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

Fix for not being able to install app on specific Tizen TVs #1669

Merged
merged 8 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/app-harness/appConfigs/harness/renative.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@
}
},
"tizen": {
"package": "NkVRhWHJST",
"id": "NkVRhWHJST.RNVanillaTV"
"package": "NkVRhWHJSX",
"id": "NkVRhWHJSX.RNVanillaTV"
},
"tizenwatch": {
"package": "cHIP2fIRQZ",
Expand Down
24 changes: 21 additions & 3 deletions packages/sdk-tizen/src/deviceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,14 @@ export const launchTizenEmulator = async (name: string | true): Promise<boolean>
const devices_lines = devices.split('\n');

const allDownloadedEmulators = emulators.split('\n'); // all tizen, tizenwatch and tizenmobile emulators

const specificEmulators = await getSubplatformDevices(allDownloadedEmulators, c.platform as string);
const devicesArr = devices_lines.slice(1).map((line: string) => line.split(' ')[0]); // devices array with only their ip

const lines = specificEmulators.concat(devices_lines.slice(1));
const lines = specificEmulators.concat(devicesArr);

const targetsArray = lines.map((line) => ({ id: line, name: line }));

const choices = _composeDevicesString(targetsArray);

const { chosenEmulator } = await inquirerPrompt({
Expand All @@ -99,6 +102,14 @@ export const launchTizenEmulator = async (name: string | true): Promise<boolean>
}

if (name) {
const ipRegex = /^(?:\d{1,3}\.){3}\d{1,3}:\d{1,5}$/;
if (name !== true && ipRegex.test(name)) {
// if ip is chosen, real device boot should start
logInfo('Connecting to device');
c.runtime.target = name.split(':')[0];
await runTizenSimOrDevice();
return true;
}
try {
await executeAsync(
`${c.cli[CLI_TIZEN_EMULATOR]} launch --name ${name}`,
Expand Down Expand Up @@ -163,7 +174,12 @@ const getSubplatformDevices = async (allTizenEmulators: string[], neededPlatform
export const listTizenTargets = async (platform: string) => {
const emulatorsString = await execCLI(CLI_TIZEN_EMULATOR, 'list-vm');
const devicesString = await execCLI(CLI_SDB_TIZEN, 'devices');
const devicesArr = devicesString.split('\n').slice(1);
const devicesArr = devicesString
.split('\n')
.slice(1)
.map((line: string) => line.split(' ')[0]);
// turns devices string: ' List of devices attached \n192.168.0.105:26101 device UE43NU7192' to only the '192.168.0.105:26101'

const allDownloadedEmulators = emulatorsString.split('\n'); // all tizen, tizenwatch and tizenmobile emulators
const specificPlatformEmulators = await getSubplatformDevices(allDownloadedEmulators.concat(devicesArr), platform); // tizen, tizenwatch, tizenmobile - only 1 of them
let targetStr = '';
Expand Down Expand Up @@ -415,7 +431,9 @@ Please create one and then edit the default target from ${c.paths.workspace.dir}

try {
const packageID = platform === 'tizenwatch' || platform === 'tizenmobile' ? tId.split('.')[0] : tId;
await execCLI(CLI_TIZEN, `uninstall -p ${packageID} -t ${deviceID}`, { ignoreErrors: true });
await execCLI(CLI_TIZEN, `uninstall -p ${packageID} -t ${deviceID}`, {
ignoreErrors: true,
});
hasDevice = true;
} catch (e) {
if (typeof e === 'string' && e.includes('No device matching')) {
Expand Down
4 changes: 2 additions & 2 deletions packages/template-starter/appConfigs/base/renative.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@
"appName": "RNVanillaTV",
"entryFile": "index",
"certificateProfile": "RNVanillaCert",
"package": "NkVRhWHJST",
"id": "NkVRhWHJST.RNVanillaTV",
"package": "NkVRhWHJSX",
"id": "NkVRhWHJSX.RNVanillaTV",
"buildSchemes": {
"debug": {
"bundleAssets": false
Expand Down
4 changes: 2 additions & 2 deletions packages/template-starter/appConfigs/template/renative.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
}
},
"tizen": {
"package": "NkVRhWHJST",
"id": "NkVRhWHJST.RNVanillaTV"
"package": "NkVRhWHJSX",
"id": "NkVRhWHJSX.RNVanillaTV"
},
"tizenwatch": {
"package": "cHIP2fIRQZ",
Expand Down
Loading