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

"tns livesync ios --watch" doesn't sync js changes if pacakgeId and folder name does not match #1532

Closed
xuezier opened this issue Feb 23, 2016 · 14 comments
Assignees
Milestone

Comments

@xuezier
Copy link

xuezier commented Feb 23, 2016

tns livesync ios --emulator --watch, js file has changed,but not sync
xml and css are working good
os x 10.11.1

The real problem:
When id of your app is "org.nativescript.TestApp" and it is placed in folder != TestApp (for example SampleApp) livesync --watch does not sync changes in js files.

Workaround: Make last part ot your app id == name of the folder where project is located.

@vchimev
Copy link

vchimev commented Feb 24, 2016

@xuezier, could you please share:

  • what is your Xcode version,
  • does the app restart changing a .js file

Can you execute tns livesync ios --emulator --watch --log trace, make a change in a .js file and send us the output?

@xuezier
Copy link
Author

xuezier commented Feb 24, 2016

Shasum of file /Users/xuezhijing/NativeScriptProject/sample-Groceries/app/views/login/login.js is 404b7e2415abf25a7a05238f7d9f4e4a455ca6aa
Adding /Users/xuezhijing/NativeScriptProject/sample-Groceries/app/views/login/login.js file with 404b7e2415abf25a7a05238f7d9f4e4a455ca6aa hash.
Syncing filePath /Users/xuezhijing/NativeScriptProject/sample-Groceries/app/views/login/login.js, mappedFilePath is /Users/xuezhijing/NativeScriptProject/sample-Groceries/platforms/ios/sampleGroceries/app/views/login/login.js
Syncing /Users/xuezhijing/NativeScriptProject/sample-Groceries/platforms/ios/sampleGroceries/app/views/login/login.js
BeforeHookName for command prepare is before-prepare
Images from Xcode project
[ 'Default-568h@2x.png',
'Default-Landscape.png',
'Default-Landscape@2x.png',
'Default-Portrait.png',
'Default-Portrait@2x.png',
'Default.png',
'Default@2x.png',
'Icon-40@3x.png',
'Icon-60@3x.png',
'Icon-Small-50.png',
'Icon-Small-50@2x.png',
'Icon-Small.png',
'Icon-Small@2x.png',
'Icon-Small@3x.png',
'icon-40.png',
'icon-40@2x.png',
'icon-60.png',
'icon-60@2x.png',
'icon-72.png',
'icon-72@2x.png',
'icon-76.png',
'icon-76@2x.png',
'icon.png',
'icon@2x.png',
'logo.png',
'logo@2x.png',
'logo@3x.png' ]
Current images from App_Resources
[ 'Default-568h@2x.png',
'Default-Landscape.png',
'Default-Landscape@2x.png',
'Default-Portrait.png',
'Default-Portrait@2x.png',
'Default.png',
'Default@2x.png',
'Icon-40@3x.png',
'Icon-60@3x.png',
'Icon-Small-50.png',
'Icon-Small-50@2x.png',
'Icon-Small.png',
'Icon-Small@2x.png',
'Icon-Small@3x.png',
'icon-40.png',
'icon-40@2x.png',
'icon-60.png',
'icon-60@2x.png',
'icon-72.png',
'icon-72@2x.png',
'icon-76.png',
'icon-76@2x.png',
'icon.png',
'icon@2x.png',
'logo.png',
'logo@2x.png',
'logo@3x.png' ]
New images to add into xcode project:
Images to remove from xcode project:
Info.plist: Start
Info.plist: Patch 'app/App_Resources/iOS/Info.plist'
Info.plist: Patch 'CFBundleIdentifier from package.json nativescript.id'
Info.plist: Complete
Info.plist: Write to: /Users/xuezhijing/NativeScriptProject/sample-Groceries/platforms/ios/sampleGroceries/sampleGroceries-Info.plist
Project successfully prepared
AfterHookName for command prepare is after-prepare
Transferring project files...
Transferring from /Users/xuezhijing/NativeScriptProject/sample-Groceries/platforms/ios/sampleGroceries/app/views/login/login.js to /Users/xuezhijing/Library/Developer/CoreSimulator/Devices/45EF8838-623B-4B0B-9AC8-C0DF4C9978D2/data/Containers/Bundle/Application/7B2B3383-6DCD-4133-9B78-E42F0FAB6075/sampleGroceries.app/app/views/login/login.js
Successfully transferred all project files.
Applying changes...
Successfully synced application org.nativescript.groceries on device 45EF8838-623B-4B0B-9AC8-C0DF4C9978D2.
hasum of file /Users/xuezhijing/NativeScriptProject/sample-Groceries/app/views/login/login.js is 404b7e2415abf25a7a05238f7d9f4e4a455ca6aa
Adding /Users/xuezhijing/NativeScriptProject/sample-Groceries/app/views/login/login.js file with 404b7e2415abf25a7a05238f7d9f4e4a455ca6aa hash.
Syncing filePath /Users/xuezhijing/NativeScriptProject/sample-Groceries/app/views/login/login.js, mappedFilePath is /Users/xuezhijing/NativeScriptProject/sample-Groceries/platforms/ios/sampleGroceries/app/views/login/login.js
Syncing /Users/xuezhijing/NativeScriptProject/sample-Groceries/platforms/ios/sampleGroceries/app/views/login/login.js

@xuezier
Copy link
Author

xuezier commented Feb 24, 2016

xcode version: 7.2.1
the app has not restart after the js file changed

@xuezier
Copy link
Author

xuezier commented Feb 24, 2016

@vchimev help! QAQ

@vchimev
Copy link

vchimev commented Feb 24, 2016

@xuezier, thank you for the details.

The issue is in the way we try to restart the app during LiveSync on iOS Simulator. However, you could easily workaround it by setting the id value in the package.json file as follows:

"nativescript": {
        "id": "com.tjvantoll.sampleGroceries",

@tjvantoll, could we make the same update to the repository to avoid the problem while there is a fix?
Ping @rosen-vladimirov and @Mitko-Kerezov for looking into a fix for this issue.

@xuezier
Copy link
Author

xuezier commented Feb 24, 2016

ok,the problem is solved.
thank you!!!

@rosen-vladimirov rosen-vladimirov self-assigned this Feb 24, 2016
@rosen-vladimirov rosen-vladimirov added this to the 1.7.0 milestone Feb 24, 2016
@tjvantoll
Copy link
Contributor

@vchimev: The "id" should already be in place in Groceries, see https://github.com/NativeScript/sample-Groceries/blob/master/package.json#L29-L30. Or am I missing something here?

@tjvantoll
Copy link
Contributor

@vchimev explained the problem to me on Slack. I just updated Groceries’ app id to workaround the problem.

@cdalsoniii
Copy link

@i am having the same issue. That command does not restart my ios emulator. Is there a slack session I can join where I can share my log files?
Nativescript_iOS Emulator_Livesync problems.docx

@vchimev
Copy link

vchimev commented Feb 29, 2016

Hi @cdalsoniii,

the issue here is that the last part of the id field should match the name of the root folder of your NativeScript project in order LiveSync to work on iOS Simulator. In your case you could:

  • rename sample-ng-todomvc_instructions_included folder to sample-ng-todomvc

or

  • set the id field to match the root folder of your project:
"nativescript": {
        "id": "org.nativescript.nativescripttodomvcinstructionsincluded",

@cdalsoniii
Copy link

I actually chose the second option above and still am having trouble
syncing my project. Is there a Slack account where I could discuss this
with you? I have tried numerous configurations.

  • Clifford Dalson III

NOTE: The information contained in this transmission, including any
attachment(s) is only for the use of the intended individual(s) or entity,
and may contain information that is privileged and confidential. If the
reader of this message is not an intended recipient, you are hereby
notified that any dissemination, distribution, disclosure, or copying of
this information is unauthorized and strictly prohibited. If you have
received this communication in error, please contact the sender immediately
by reply email and destroy all copies of the original message

On Mon, Feb 29, 2016 at 6:14 AM, Vasil Chimev notifications@github.com
wrote:

Hi @cdalsoniii https://github.com/cdalsoniii,

the issue here is that the last part of the id field should match the
name of the root folder of your NativeScript project in order LiveSync to
work on iOS Simulator. In your case you could:

  • rename sample-ng-todomvc_instructions_included folder to
    sample-ng-todomvc

or

  • set the id field to match the root folder of your project:

"nativescript": {
"id": "org.nativescript.nativescripttodomvcinstructionsincluded",


Reply to this email directly or view it on GitHub
#1532 (comment)
.

@cdalsoniii
Copy link

Are you able to respond to my message vchimev?

@vchimev
Copy link

vchimev commented Mar 7, 2016

Hi @cdalsoniii,

I just updated the sample-ng-todomvc repository (in order to avoid the issue with syncing on iOS simulator) and with {N} CLI 1.6.2 executed:

git clone git@github.com:NativeScript/sample-ng-todomvc.git
cd sample-ng-todomvc
tns livesync ios --emulator --watch

After the steps above, every change in the main-page.ts file get synced on the simulator and the app restarts. Could you please try the same at your end?

If you still have a trouble, you could open a new issue here and/or discuss it in NativeScript Community on Slack or NativeScript Google Group

@dtopuzov dtopuzov changed the title tns version 1.6.1 tns livesync ios --emulator --watch doesn't sync changes tns livesync ios --emulator --watch doesn't sync changes if pacakgeId and folder name does not match Mar 12, 2016
@dtopuzov dtopuzov changed the title tns livesync ios --emulator --watch doesn't sync changes if pacakgeId and folder name does not match "tns livesync ios --watch" doesn't sync js changes if pacakgeId and folder name does not match Mar 12, 2016
@rosen-vladimirov rosen-vladimirov modified the milestones: 2.0, 1.7.0 Mar 14, 2016
@dtopuzov
Copy link
Contributor

dtopuzov commented Apr 6, 2016

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants