Eigene FhemNative Version erstellen

Begonnen von Syrex-o, 02 Dezember 2019, 08:49:43

Vorheriges Thema - Nächstes Thema

Syrex-o

Hey zusammen,

Da FhemNative inzwischen verschiedene Platformen unterstützt, ist es für mich jedes mal ein Akt jede Version für jedes System bereit zu stellen.
Daher gilt ab jetzt folgendes:
1. An dem bisherigen Platform-Handling ändert sich nichts.
2. Alternative Platformen müssen selbst erstellt werden.

Versionen die von mir als fertiger build zur Verfügung gestellt werden:

  • Android
  • MacOS
  • Windows

Versionen die nicht von mir zur Verfügung gestellt werden:

  • Linux (Debian etc.)
  • iOS

Custom Build erstellen:
Für alle die gerne eine Version von FhemNative haben möchten, die nicht offiziell erstellt wird, bedarf es etwas Selbstinitiative.
1.) FhemNative kann von GitHub per:
clone https://github.com/Syrex-o/FhemNative
erhalten werden.

2.) Anschließend in den Development Ordner navigieren:
cd 'Path to FhemNative root'

3.) Dann die notwendigen Pakete installieren:
npm install

4. a)
iOS:
iOS Version erstellen per:
npm run build:app:prod:android:ios
Der Befehl erledigt folgendes für euch:

  • Produktion Build erstellen
  • XCode mit dem Projekt öffnen
Anschließend müsst ihr eure App signieren siehe:
https://ionicframework.com/docs/v3/intro/deploying/
https://ionicframework.com/docs/building/ios

4. b)
Linux:
Auf einem Linux Betriebssystem folgenden Befehl ausführen:
npm run build:electron:prod:linux


Notes:
Ich würde mich freuen, wenn sich Leute für die beiden Systeme verantwortlich fühlen und bei Versionsupdates einen Pull Request auf Github stellen.

Beste Grüße

supernova1963

Zitat von: Syrex-o am 02 Dezember 2019, 08:49:43
Custom Build erstellen:
Für alle die gerne eine Version von FhemNative haben möchten, die nicht offiziell erstellt wird, bedarf es etwas Selbstinitiative.
1.) FhemNative kann von GitHub per:
clone https://github.com/Syrex-o/FhemNative
erhalten werden.

2.) Anschließend in den Development Ordner navigieren:
cd 'Path to FhemNative root'/Development/FhemNative

3.) Dann die notwendigen Pakete installieren:
npm install


...

npm WARN The package @angular/compiler is included as both a dev and production dependency.

added 1955 packages from 1310 contributors and audited 19740 packages in 36.848s

1 package is looking for funding
  run `npm fund` for details

found 3 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
Gernot@MacBook-Pro FhemNative % npm audit fix                                             
npm WARN @angular/animations@8.2.4 requires a peer of @angular/core@8.2.4 but none is installed. You must install peer dependencies yourself.
npm WARN The package @angular/compiler is included as both a dev and production dependency.

updated 2 packages in 6.064s

1 package is looking for funding
  run `npm fund` for details

fixed 3 of 3 vulnerabilities in 19740 scanned packages

Gernot@MacBook-Pro FhemNative % npm fund
FhemNative@2.1.2
└─┬ qs@6.9.1
  └── url: https://github.com/sponsors/ljharb


Bis hier hin hat scheinbar alles funktioniert ("3 high severity vulnerabilities" und der "Finanzierungssuche von ljharb").

Zitat von: Syrex-o am 02 Dezember 2019, 08:49:43
4. a)
iOS:
iOS Version erstellen per:
npm run ios:prod
Der Befehl erledigt folgendes für euch:

  • Produktion Build erstellen
Hat nicht funktioniert:

Gernot@MacBook-Pro FhemNative % npm run ios:prod                                         
npm ERR! missing script: ios:prod
npm ERR!
npm ERR! Did you mean this?
npm ERR!     prod

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Gernot/.npm/_logs/2019-12-03T12_56_27_108Z-debug.log

Zitat von: Syrex-o am 02 Dezember 2019, 08:49:43
Anschließend müsst ihr eure App signieren siehe:
https://ionicframework.com/docs/v3/intro/deploying/

Ich habe dennoch xcode geöffnet und die Signatur erfolgreich durchgeführt!

Zitat von: Syrex-o am 02 Dezember 2019, 08:49:43
https://ionicframework.com/docs/building/ios
Hier wurde das Projekt generiert: "1. Generate the native project, if it does not already exist".

Gernot@MacBook-Pro FhemNative % ionic cordova prepare ios                     
✔ Creating ./www directory for you - done!
> ng run app:ionic-cordova-build --platform=ios
                                                                                                                                             
chunk {0} 0.js, 0.js.map () 14.7 kB  [rendered]
chunk {1} 1.js, 1.js.map () 16 kB  [rendered]
chunk {2} 2.js, 2.js.map () 16.2 kB  [rendered]
...
chunk {tap-click-b300ec79-js} tap-click-b300ec79-js.js, tap-click-b300ec79-js.js.map (tap-click-b300ec79-js) 6.32 kB  [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 8.18 MB [initial] [rendered]
Date: 2019-12-03T14:21:24.524Z - Hash: ec055e78a309a7fec504 - Time: 35464ms
> cordova prepare ios


Danach habe ich den workspace wieder in xcode geladen und "2. Set the Package ID."  ebenfalls durchgeführt (s. Anhang Signing und Package ID).
Anschließend, ohne weitere Änderungen, den Simulationslauf auf einem iPhone 11 mit "run" gestartet.
Ad hoc ergaben sich wie in den Anlagen "Test im Edit - Mode" und "Testansicht" ersichtlich folgende Abweichungen zur OS X Version:
- Menü Speichern und Abbrechen im Edit - Mode sind hinter der Kamera teilweise verdeckt und schwer zu erreichen
- Das Thermostat Widget ist nicht animiert

Anschliessend habe ich die App noch auf mein Test - iPhone X geladen. Die App läuft mit den o.g. ersten festgestellten  Einschränkungen.

Macht es Sinn weiter zu testen ?

Danke,

Gernot 

Syrex-o

Zitat
Zitat von: Syrex-o am Gestern um 08:49:43
4. a)
iOS:
iOS Version erstellen per:
npm run ios:prod
Der Befehl erledigt folgendes für euch:
Produktion Build erstellen
Hat nicht funktioniert:
Der Befehl ist ab heute integriert worden (2.1.3).
Das soll nur die Befehlseingabe erleichtern. Es macht nichts anderes als prepare ios und Xcode öffnen.

Also:
ZitatMacht es Sinn weiter zu testen ?
Ja durchaus.

Zitat- Menü Speichern und Abbrechen im Edit - Mode sind hinter der Kamera teilweise verdeckt und schwer zu erreichen
- Das Thermostat Widget ist nicht animiert
Die Animation vom Thermostat lässt sich aus und anschalten. Geht das wirklich nicht ?

Die Layout-Punkte gucke ich mir an und behebe sie für 2.1.4.

Beste Grüße

supernova1963

Ich habe gerade erst gesehen, dass Du die Version 2.1.3 heute erstellt hast.

Verbesserung:

Gernot@MacBook-Pro FhemNative % npm run ios:prod                                               

> FhemNative@2.1.3 ios:prod /Users/Gernot/github/FhemNative/Development/FhemNative
> ionic cordova build ios --prod && open -a Xcode platforms/ios/

✔ Creating ./www directory for you - done!
> ng run app:ionic-cordova-build:production --platform=ios
                                                                                                               
chunk {0} common.40f4984957188600e893.js (common) 9.36 kB  [rendered]
chunk {1} runtime.c7c9e44ed6d1cd764b08.js (runtime) 4.57 kB [entry] [rendered]
chunk {2} 2.ac8e287bc473bf7a7ae7.js () 604 bytes  [rendered]
...
chunk {97} 97.ea67ac51b13378ee52c0.js () 77.1 kB  [rendered]
chunk {98} 98.3afc4ffdd13358e21ff7.js () 7.59 kB  [rendered]
chunk {99} 99.33a0c182cf0abb3c18c5.js () 17.5 kB  [rendered]
chunk {cordova} cordova.17fb1a7c009cbc8d5d42.js (cordova) 22.8 kB [entry] [rendered]
Date: 2019-12-03T16:52:52.815Z - Hash: c4380a4e4c88e771564d - Time: 80298ms
> cordova build ios
CordovaError: Promise rejected with non-error: 'ios-deploy was not found. Please download, build and install version 1.9.2 or greater from https://github.com/phonegap/ios-deploy into your path, or do \'npm install -g ios-deploy\''
    at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:29:15)
    at process._tickCallback (internal/process/next_tick.js:68:7)
[ERROR] An error occurred while running subprocess cordova.
       
        cordova build ios exited with exit code 1.
       
        Re-running this command with the --verbose flag may provide more information.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! FhemNative@2.1.3 ios:prod: `ionic cordova build ios --prod && open -a Xcode platforms/ios/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the FhemNative@2.1.3 ios:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Gernot/.npm/_logs/2019-12-03T16_52_56_350Z-debug.log



Nach der Pflege der Package ID und des Signings in xcode wurde die Simulation jedoch ausgeführt (Ergebnis s. "Anhang Testansicht 2.1.3")

lg

Gernot

PS:
Zitat von: Syrex-o am 03 Dezember 2019, 17:59:40
Die Animation vom Thermostat lässt sich aus und anschalten. Geht das wirklich nicht ?
Ich habe die Animation auch ausgeschaltet, gespeichert und wieder eingeschaltet ...

Syrex-o

Zitat
ZitatZitat von: Syrex-o am Gestern um 17:59:40 Die Animation vom Thermostat lässt sich aus und anschalten. Geht das wirklich nicht ?
Ich habe die Animation auch ausgeschaltet, gespeichert und wieder eingeschaltet ...

Es scheint als würde Safari die Verläufe aus SVG´s nicht mögen. Zumindest im Simulator.

Hast du die App schon mal auf einem echten IOS Gerät laufen lassen?

Beste Grüße

supernova1963

#5
Zitat von: Syrex-o am 04 Dezember 2019, 11:33:26
Hast du die App schon mal auf einem echten IOS Gerät laufen lassen?

ja, auch dort fehlt die Animation.

Gernot

P.S.:
Auch wenn ich die app für einen Browser starte (ionic server --external) werden weder in Chrome noch in Safari Animationen gezeigt.
Die OS X App funktioniert!

Syrex-o

Zitatja, auch dort fehlt die Animation.
Kannst du bei IOS den webview wechseln?

ZitatP.S.: Auch wenn ich die app für einen Browser starte (ionic server --external) werden weder in Chrome noch in Safari Animationen gezeigt.
Das macht wenig Sinn so. Um die Chrome Dev tools zu verwenden einfach:
npm run electron:dev

Beste Grüße

supernova1963

#7
Wo könnte ich suchen? "webview" kommt 660 x in dem workspace vor.
Könnte es ggf. auch das Maininterface sein (Standard = "").

Danke,

Gernot

Edit: Vielleicht hilft die ISSUE Liste des BUID Vorgangs aus xcode

Syrex-o

Zitat von: supernova1963 am 04 Dezember 2019, 14:05:04
Wo könnte ich suchen? "webview" kommt 660 x in dem workspace vor.
Könnte es ggf. auch das Maininterface sein (Standard = "").

Ich meine im ios device selbst (simulator oder tatsächliches Gerät). Ich weiß nicht, ob man die webview Anwendung bei ios ändern kann.
Android hat diese Option.

Beste Grüße

supernova1963

Hey,

du bist ja rasend schnell.
Wenn auch spät, antworte auf Deine Frage:
Zitat von: Syrex-o am 04 Dezember 2019, 14:36:17
Ich meine im ios device selbst (simulator oder tatsächliches Gerät). Ich weiß nicht, ob man die webview Anwendung bei ios ändern kann.
webview Einstellungen habe ich nicht direkt gefunden, aber vielleicht sagen Dir die anhängenden "experimentelle Einsteillung" etwas.

lg

Gernot

Syrex-o

Zitat von: supernova1963 am 07 Dezember 2019, 14:25:48
Hey,

du bist ja rasend schnell.
Wenn auch spät, antworte auf Deine Frage:webview Einstellungen habe ich nicht direkt gefunden, aber vielleicht sagen Dir die anhängenden "experimentelle Einsteillung" etwas.

Na logisch  ;)

Ich hab mich mal etwas belesen. Das ist tatsächlich ein Problem von safari. Ich muss mal gucken, wie man die SVG Pfade als Farbverlauf für Safari fixen kann.
Die webview kann man leider nicht ändern und experimentelle features helfen leider auch nicht.

Kannst du die generierte IOS Anwendung einfach auf jeden Gerät installieren?

Beste Grüße

supernova1963

Zitat von: Syrex-o am 07 Dezember 2019, 22:15:49
Kannst du die generierte IOS Anwendung einfach auf jeden Gerät installieren?
Hey,

kann ich nicht sagen. Nach  diesem Artikel, vielleicht, aber eher nicht, oder?

lg

Gernot

Syrex-o

Zitat von: supernova1963 am 08 Dezember 2019, 06:52:26
Hey,

kann ich nicht sagen. Nach  diesem Artikel, vielleicht, aber eher nicht, oder?

Dann bleibt es wohl erst einmal dein privater Vorteil  ;). Sicherlich gibt es aber einen Weg.

Beste Grüße

grossmaggul

Hallo,

ich habe mich auch mal an einer iOS Version versucht, ich muß allerdings vorausschicken, daß ich mich mit XCode überhaupt nicht auskenne.:-/
Vielleicht kann mir ja jemand unter die Arme greifen.

Ich habe die im ersten Post aufgeführten Befehle im Terminal eingegeben, das lief auch soweit durch, nur "npm run ios:prod" wirft mir am Ende das hier aus:

Date: 2020-01-20T13:39:31.546Z - Hash: 184b618f06d552c9613a - Time: 72715ms

WARNING in Invalid animation value at 162:26. Ignoring.

WARNING in Invalid animation value at 371:26. Ignoring.

WARNING in budgets, maximum exceeded for initial. Budget 2 MB was exceeded by 193 kB.
> cordova build ios
Cannot read property 'toLowerCase' of undefined
[ERROR] An error occurred while running subprocess cordova.

        cordova build ios exited with exit code 1.

        Re-running this command with the --verbose flag may provide more
        information.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! FhemNative@2.2.3 ios:prod: `ionic cordova build ios --prod && open -a Xcode platforms/ios/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the FhemNative@2.2.3 ios:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/maanke/.npm/_logs/2020-01-20T13_39_34_856Z-debug.log

Was will mir das jetzt sagen, bzw. wie gehe ich weiter vor?

gm
FHEM auf Debian Buster Server, 2 x nanoCUL868, 1xnanoCUL465; Homematic, MAX, MiLight, HUE,  2 x Gosund SP1

Syrex-o

Zitat von: grossmaggul am 20 Januar 2020, 14:50:12
Hallo,

ich habe mich auch mal an einer iOS Version versucht, ich muß allerdings vorausschicken, daß ich mich mit XCode überhaupt nicht auskenne.:-/
Vielleicht kann mir ja jemand unter die Arme greifen.

Ich habe die im ersten Post aufgeführten Befehle im Terminal eingegeben, das lief auch soweit durch, nur "npm run ios:prod" wirft mir am Ende das hier aus:

Date: 2020-01-20T13:39:31.546Z - Hash: 184b618f06d552c9613a - Time: 72715ms

WARNING in Invalid animation value at 162:26. Ignoring.

WARNING in Invalid animation value at 371:26. Ignoring.

WARNING in budgets, maximum exceeded for initial. Budget 2 MB was exceeded by 193 kB.
> cordova build ios
Cannot read property 'toLowerCase' of undefined
[ERROR] An error occurred while running subprocess cordova.

        cordova build ios exited with exit code 1.

        Re-running this command with the --verbose flag may provide more
        information.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! FhemNative@2.2.3 ios:prod: `ionic cordova build ios --prod && open -a Xcode platforms/ios/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the FhemNative@2.2.3 ios:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/maanke/.npm/_logs/2020-01-20T13_39_34_856Z-debug.log

Was will mir das jetzt sagen, bzw. wie gehe ich weiter vor?

gm

Kannst du herausfinden aus welchem File das Problem kommt?

Beste Grüße