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

ios-deploy installing over both USB and WiFi #170

Closed
paulshapiro opened this issue Sep 10, 2015 · 27 comments
Closed

ios-deploy installing over both USB and WiFi #170

paulshapiro opened this issue Sep 10, 2015 · 27 comments
Labels
Milestone

Comments

@paulshapiro
Copy link

Even though the device is detected over USB and installation is initiated and completed over USB, after installation and entry into the debug phase, ios-deploy will detect the device over WIFI subsequently install the app over the air, even though it had just done so over USB. This also seems to step on any attempt to engage the debugger over USB. This only happens when WiFi is turned on, on the device. Seems like a bug that a duplicate install would happen. Specifying the device identifier with -i doesn't change the outcome. ios-deploy -c only lists one device, connected via USB.

@shazron shazron added the bug label Sep 18, 2015
@shazron shazron modified the milestone: 1.8.0 Sep 18, 2015
@adbl
Copy link

adbl commented Sep 22, 2015

+1

1 similar comment
@dhayab
Copy link

dhayab commented Sep 28, 2015

👍

@shazron
Copy link

shazron commented Oct 6, 2015

Thanks for the report. Not sure how to debug this, I haven't seen this yet in my testing. Any particular command line flags?

Do you mean during one deploy, it tries to deploy twice when two interfaces are detected for a device?

@dhayab
Copy link

dhayab commented Oct 6, 2015

Hi @shazron, here is a log for a simple ios-deploy -d -b package.app: https://gist.github.com/dhayab/ed6eec9d47c4e1c71325. I can confirm that when WiFi is off on the device, the command works as expected.

@shazron
Copy link

shazron commented Oct 6, 2015

Thank you! That helps a lot.

@shazron
Copy link

shazron commented Oct 6, 2015

Thinking out loud...
On this line: https://gist.github.com/dhayab/ed6eec9d47c4e1c71325#file-gistfile1-txt-L29
There should be lines starting with the prefix "(lldb)" as the debugger is started, but it's starting a new Install Phase again.

I think the "Waiting for iOS device to be connected" phase was not terminated properly leading to this situation. Here we subscribe: https://github.com/phonegap/ios-deploy/blob/adc8a5b9c298d901d4388bb5cba20f9049b2dc83/ios-deploy.c#L1971 but there is no unsubscribe once a device connection was found.

@ptarjan
Copy link

ptarjan commented Oct 6, 2015

+1 I'm hitting this as well.

Simply plugging in a device, turning on the WIFI and running

ios-deploy -d -b ./platforms/ios/build/device/Trimian.app

It deploys once over USB then again over WIFI. If I turn off WIFI then do it again, it didn't work, then I waited a minute and did it again and magically it worked. Is there some registry of devices it hears over WIFI that takes a bit of time to purge? Similarly, if I just quickly turn on my WIFI I don't hit this bug, but if my WIFI was on for a while then I hit it.

@shazron shazron closed this as completed in 3756385 Oct 6, 2015
@shazron
Copy link

shazron commented Oct 6, 2015

Pushed a fix, will be out in v1.8.0. It's ugly but it'll do for now until a re-factor in v2.0

@shazron
Copy link

shazron commented Oct 7, 2015

1.8.0 is out, please test and report if this is still a problem, thanks.

@paulshapiro
Copy link
Author

@shazron hey there. I'm unfortunately still getting this problem with 1.8.0. Please help! Would it be possible to add a flag to simply completely turn off WiFi in ios-deploy as well? It would be a workaround while the bug itself is being diagnosed.

@paulshapiro
Copy link
Author

@shazron When I turn off WiFi on the device, ios-deploy also apparently still thinks that the device is connected over WiFi, and tries to do the upload, but fails at AMDeviceValidatePairing(device) with a "This device is no longer connected." This causes ios-deploy to exit, and not launch the app that it has already installed over USB. Help appreciated.

@shazron shazron reopened this Oct 8, 2015
@shazron
Copy link

shazron commented Oct 8, 2015

Good idea for the flag. The trouble is I can't repro this to fix this properly, and will have to rely on you to test. I'll put it in a branch for you to test, and report back.

I'll add the flag --no-wifi

shazron added a commit that referenced this issue Oct 8, 2015
@shazron
Copy link

shazron commented Oct 8, 2015

I just pushed 1.8.1 with more verbose logging. Add --verbose and post a log when this issue happens.

@paulshapiro
Copy link
Author

@shazron I couldn't repro the issue after testing 1.8.1. I'm using --verbose though so if I see it again I'll have some logs for you.

Re: --no-wifi - I couldn't find that branch. Am I too early?
I'd really love to be able to disable wifi, as, when I disconnect USB, ios-deploy does still try to upload over Wifi, which can be an issue for bigger apps, and iosdeploy can't debug over wifi, etc.

@paulshapiro
Copy link
Author

By the way, I think the 'installs over both usb and wifi' issue may be happening when I disconnect the device via USB, try to install w/o a USB connection (ios-deploy goes over wifi), and then reconnect and try installing again - it seems to install over both vectors. I'll have a log for you in a minute.

@paulshapiro
Copy link
Author

Yes, it seems to install over USB first, and then install over wifi, but then fail to start to debug the app, as it is trying to do so over WiFi.

@paulshapiro
Copy link
Author

@shazron Here's the log of me installing the app after having disconnected USB, trying to install (at which point it installs over wifi), and then reconnecting USB, and installing again. Note that it installs twice.

https://gist.github.com/paulshapiro/2f81391af59aba39b1d2

@paulshapiro
Copy link
Author

@shazron Any way we might be able to expedite the --no-wifi flag? At the moment, this issue is occurring 100% of the time in most of my testing, and it thoroughly prevents ios-deploy from launching the app.

@tboyce12
Copy link

+1 on this issue.
xcodebuild and ios-deploy logs

@jenil
Copy link

jenil commented Nov 2, 2015

Same here, the app is deployed over Wifi even though USB device is detected. When can we expect a fix for this?

Log:

jenil@Jenils-MBP ~/W/a/oto> ios-deploy -d -v -b /Users/jenil/Work/.../oto.app
[....] Waiting for iOS device to be connected
Handling device type: 1
Already found device? 0
Device Name: Jenil's iPhone
Model Name: iPhone 6 (GSM)
[....] Using iPhone 6 (GSM) 'Jenil's iPhone' (8804f10b43da1).
------ Install phase ------
[  0%] Found iPhone 6 (GSM) 'Jenil's iPhone' (8804f10b43da1) connected through USB, beginning install
[  5%] Copying /Users/jenil/Work/.../oto.app/META-INF/ to device
[  5%] Copying /Users/jenil/Work/.../oto.app/META-INF/com.apple.ZipMetadata.plist to device
[  5%] Copying /Users/jenil/Work/.../oto.app/_CodeSignature/ to device
[  5%] Copying /Users/jenil/Work/.../oto.app/_CodeSignature/CodeResources to device
[  6%] Copying /Users/jenil/Work/.../oto.app/CDVNotification.bundle/ to device
[  6%] Copying /Users/jenil/Work/.../oto.app/CDVNotification.bundle/beep.wav to device
[  6%] Copying /Users/jenil/Work/.../oto.app/config.xml to device
[  7%] Copying /Users/jenil/Work/.../oto.app/Default-568h@2x~iphone.png to device
[  7%] Copying /Users/jenil/Work/.../oto.app/Default-667h.png to device
[  8%] Copying /Users/jenil/Work/.../oto.app/Default-736h.png to device
[  9%] Copying /Users/jenil/Work/.../oto.app/Default-Landscape-736h.png to device
[  9%] Copying /Users/jenil/Work/.../oto.app/Default-Landscape@2x~ipad.png to device
[ 10%] Copying /Users/jenil/Work/.../oto.app/Default-Landscape~ipad.png to device
[ 11%] Copying /Users/jenil/Work/.../oto.app/Default-Portrait@2x~ipad.png to device
[ 12%] Copying /Users/jenil/Work/.../oto.app/Default-Portrait~ipad.png to device
[ 13%] Copying /Users/jenil/Work/.../oto.app/Default@2x~iphone.png to device
[ 13%] Copying /Users/jenil/Work/.../oto.app/Default~iphone.png to device
[ 14%] Copying /Users/jenil/Work/.../oto.app/embedded.mobileprovision to device
[ 14%] Copying /Users/jenil/Work/.../oto.app/icon-40.png to device
[ 15%] Copying /Users/jenil/Work/.../oto.app/icon-40@2x.png to device
[ 15%] Copying /Users/jenil/Work/.../oto.app/icon-50.png to device
[ 15%] Copying /Users/jenil/Work/.../oto.app/icon-50@2x.png to device
[ 16%] Copying /Users/jenil/Work/.../oto.app/icon-60.png to device
[ 16%] Copying /Users/jenil/Work/.../oto.app/icon-60@2x.png to device
[ 16%] Copying /Users/jenil/Work/.../oto.app/icon-60@3x.png to device
[ 17%] Copying /Users/jenil/Work/.../oto.app/icon-72.png to device
[ 17%] Copying /Users/jenil/Work/.../oto.app/icon-72@2x.png to device
[ 18%] Copying /Users/jenil/Work/.../oto.app/icon-76.png to device
[ 18%] Copying /Users/jenil/Work/.../oto.app/icon-76@2x.png to device
[ 18%] Copying /Users/jenil/Work/.../oto.app/icon-small.png to device
[ 19%] Copying /Users/jenil/Work/.../oto.app/icon-small@2x.png to device
[ 19%] Copying /Users/jenil/Work/.../oto.app/icon.png to device
[ 19%] Copying /Users/jenil/Work/.../oto.app/icon@2x.png to device
[ 20%] Copying /Users/jenil/Work/.../oto.app/Info.plist to device
[ 20%] Copying /Users/jenil/Work/.../oto.app/MainViewController.nib to device
[ 20%] Copying /Users/jenil/Work/.../oto.app/oto to device
[ 23%] Copying /Users/jenil/Work/.../oto.app/PkgInfo to device
[ 23%] Copying /Users/jenil/Work/.../oto.app/ResourceRules.plist to device
[ 23%] Copying /Users/jenil/Work/.../oto.app/www/ to device
[ 24%] Copying /Users/jenil/Work/.../oto.app/www/cordova.js to device
[ 24%] Copying /Users/jenil/Work/.../oto.app/www/cordova_plugins.js to device
[ 25%] Copying /Users/jenil/Work/.../oto.app/www/fonts/ to device
[ 25%] Copying /Users/jenil/Work/.../oto.app/www/fonts/ionicons.eot to device
[ 26%] Copying /Users/jenil/Work/.../oto.app/www/fonts/ionicons.svg to device
[ 28%] Copying /Users/jenil/Work/.../oto.app/www/fonts/ionicons.ttf to device
[ 29%] Copying /Users/jenil/Work/.../oto.app/www/fonts/ionicons.woff to device
[ 30%] Copying /Users/jenil/Work/.../oto.app/www/index.html to device
[ 30%] Copying /Users/jenil/Work/.../oto.app/www/oto-app-46c828.js to device
[ 42%] Copying /Users/jenil/Work/.../oto.app/www/plugins/ to device
[ 42%] Copying /Users/jenil/Work/.../oto.app/www/plugins/com.ionic.keyboard/ to device
[ 43%] Copying /Users/jenil/Work/.../oto.app/www/plugins/com.ionic.keyboard/www/ to device
[ 43%] Copying /Users/jenil/Work/.../oto.app/www/plugins/com.ionic.keyboard/www/keyboard.js to device
[ 43%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-console/ to device
[ 44%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-console/www/ to device
[ 44%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-console/www/console-via-logger.js to device
[ 44%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-console/www/logger.js to device
[ 45%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-device/ to device
[ 45%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-device/www/ to device
[ 45%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-device/www/device.js to device
[ 46%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-dialogs/ to device
[ 46%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-dialogs/www/ to device
[ 46%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-dialogs/www/notification.js to device
[ 47%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-geolocation/ to device
[ 47%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-geolocation/www/ to device
[ 47%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-geolocation/www/Coordinates.js to device
[ 48%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-geolocation/www/geolocation.js to device
[ 48%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-geolocation/www/Position.js to device
[ 48%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-geolocation/www/PositionError.js to device
[ 49%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-splashscreen/ to device
[ 49%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-splashscreen/www/ to device
[ 49%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-splashscreen/www/splashscreen.js to device
[ 52%] CreatingStagingDirectory
[ 57%] ExtractingPackage
[ 60%] InspectingPackage
[ 60%] TakingInstallLock
[ 65%] PreflightingApplication
[ 65%] InstallingEmbeddedProfile
[ 70%] VerifyingApplication
[ 75%] CreatingContainer
[ 80%] InstallingApplication
[ 85%] PostflightingApplication
[ 90%] SandboxingApplication
[ 95%] GeneratingApplicationMap
[100%] Installed package /Users/jenil/Work/.../oto.app
Device Name: Jenil's iPhone
Model Name: iPhone 6 (GSM)
------ Debug phase ------
Starting debug of iPhone 6 (GSM) 'Jenil's iPhone' (8804f10b43da1) connected through USB...
Device support path: /Users/jenil/Library/Developer/Xcode/iOS DeviceSupport/9.0.2 (13A452)
Developer disk image: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/9.0/DeveloperDiskImage.dmg
[  0%] Looking up developer disk image
[ 95%] Developer disk image mounted successfully
[100%] Connecting to remote debug server
-------------------------
Handling device type: 2
Already found device? 1
Device Name: (null)
Model Name: Unknown Device
[....] Using (8804f10b43da1ss).
------ Install phase ------
[  0%] Found (8804f10b43da1ss) connected through WIFI, beginning install
(lldb) command source -s 0 '/tmp/2C7F1527-7BEF-4AD0-960D-247CE9A57074/fruitstrap-lldb-prep-cmds-8804f10b43da1'
Executing commands in '/tmp/2C7F1527-7BEF-4AD0-960D-247CE9A57074/fruitstrap-lldb-prep-cmds-8804f10b43da1'.
(lldb)     platform select remote-ios --sysroot '/Users/jenil/Library/Developer/Xcode/iOS DeviceSupport/9.0.2 (13A452)/Symbols'
  Platform: remote-ios
 Connected: no
  SDK Path: "/Users/jenil/Library/Developer/Xcode/iOS DeviceSupport/9.0.2 (13A452)/Symbols"
(lldb)     target create "/Users/jenil/Work/.../oto.app"
Current executable set to '/Users/jenil/Work/.../oto.app' (armv7).
(lldb)     script fruitstrap_device_app="/private/var/mobile/Containers/Bundle/Application/B063F8B3-BB9C-48AD-A960-FEB196739B9B/oto.app"
(lldb)     script fruitstrap_connect_url="connect://127.0.0.1:49687"
(lldb)     command script import "/tmp/2C7F1527-7BEF-4AD0-960D-247CE9A57074/fruitstrap_8804f10b43da1.py"
(lldb)     command script add -f fruitstrap_8804f10b43da1.connect_command connect
(lldb)     command script add -s asynchronous -f fruitstrap_8804f10b43da1.run_command run
(lldb)     command script add -s asynchronous -f fruitstrap_8804f10b43da1.autoexit_command autoexit
(lldb)     command script add -s asynchronous -f fruitstrap_8804f10b43da1.safequit_command safequit
(lldb)     connect
[  5%] Copying /Users/jenil/Work/.../oto.app/_CodeSignature/CodeResources to device
[  5%] Copying /Users/jenil/Work/.../oto.app/CDVNotification.bundle/beep.wav to device
[  6%] Copying /Users/jenil/Work/.../oto.app/config.xml to device
[  6%] Copying /Users/jenil/Work/.../oto.app/Default-568h@2x~iphone.png to device
[  7%] Copying /Users/jenil/Work/.../oto.app/Default-667h.png to device
[  7%] Copying /Users/jenil/Work/.../oto.app/Default-736h.png to device
[  8%] Copying /Users/jenil/Work/.../oto.app/Default-Landscape-736h.png to device
[  9%] Copying /Users/jenil/Work/.../oto.app/Default-Landscape@2x~ipad.png to device
[ 10%] Copying /Users/jenil/Work/.../oto.app/Default-Landscape~ipad.png to device
[ 11%] Copying /Users/jenil/Work/.../oto.app/Default-Portrait@2x~ipad.png to device
[ 12%] Copying /Users/jenil/Work/.../oto.app/Default-Portrait~ipad.png to device
[ 12%] Copying /Users/jenil/Work/.../oto.app/Default@2x~iphone.png to device
[ 13%] Copying /Users/jenil/Work/.../oto.app/Default~iphone.png to device
[ 13%] Copying /Users/jenil/Work/.../oto.app/embedded.mobileprovision to device
[ 14%] Copying /Users/jenil/Work/.../oto.app/icon-40.png to device
[ 14%] Copying /Users/jenil/Work/.../oto.app/icon-40@2x.png to device
[ 14%] Copying /Users/jenil/Work/.../oto.app/icon-50.png to device
[ 15%] Copying /Users/jenil/Work/.../oto.app/icon-50@2x.png to device
[ 15%] Copying /Users/jenil/Work/.../oto.app/icon-60.png to device
[ 15%] Copying /Users/jenil/Work/.../oto.app/icon-60@2x.png to device
[ 16%] Copying /Users/jenil/Work/.../oto.app/icon-60@3x.png to device
[ 16%] Copying /Users/jenil/Work/.../oto.app/icon-72.png to device
[ 17%] Copying /Users/jenil/Work/.../oto.app/icon-72@2x.png to device
[ 17%] Copying /Users/jenil/Work/.../oto.app/icon-76.png to device
[ 17%] Copying /Users/jenil/Work/.../oto.app/icon-76@2x.png to device
[ 18%] Copying /Users/jenil/Work/.../oto.app/icon-small.png to device
[ 18%] Copying /Users/jenil/Work/.../oto.app/icon-small@2x.png to device
[ 19%] Copying /Users/jenil/Work/.../oto.app/icon.png to device
[ 19%] Copying /Users/jenil/Work/.../oto.app/icon@2x.png to device
[ 19%] Copying /Users/jenil/Work/.../oto.app/Info.plist to device
[ 20%] Copying /Users/jenil/Work/.../oto.app/MainViewController.nib to device
[ 20%] Copying /Users/jenil/Work/.../oto.app/oto to device
[ 22%] Copying /Users/jenil/Work/.../oto.app/PkgInfo to device
[ 23%] Copying /Users/jenil/Work/.../oto.app/ResourceRules.plist to device
[ 23%] Copying /Users/jenil/Work/.../oto.app/www/cordova.js to device
[ 24%] Copying /Users/jenil/Work/.../oto.app/www/cordova_plugins.js to device
[ 24%] Copying /Users/jenil/Work/.../oto.app/www/fonts/ionicons.eot to device
[ 25%] Copying /Users/jenil/Work/.../oto.app/www/fonts/ionicons.svg to device
[ 27%] Copying /Users/jenil/Work/.../oto.app/www/fonts/ionicons.ttf to device
[ 28%] Copying /Users/jenil/Work/.../oto.app/www/fonts/ionicons.woff to device
[ 29%] Copying /Users/jenil/Work/.../oto.app/www/index.html to device
[ 29%] Copying /Users/jenil/Work/.../oto.app/www/oto-app-46c828.js to device
[ 41%] Copying /Users/jenil/Work/.../oto.app/www/plugins/com.ionic.keyboard/www/keyboard.js to device
[ 42%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-console/www/console-via-logger.js to device
[ 43%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-console/www/logger.js to device
[ 44%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-device/www/device.js to device
[ 45%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-dialogs/www/notification.js to device
[ 46%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-geolocation/www/Coordinates.js to device
[ 46%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-geolocation/www/geolocation.js to device
[ 46%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-geolocation/www/Position.js to device
[ 47%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-geolocation/www/PositionError.js to device
[ 48%] Copying /Users/jenil/Work/.../oto.app/www/plugins/cordova-plugin-splashscreen/www/splashscreen.js to device
[ 52%] CreatingStagingDirectory
[ 57%] ExtractingPackage
[ 60%] InspectingPackage
[ 60%] TakingInstallLock
[ 65%] PreflightingApplication
[ 65%] InstallingEmbeddedProfile
[ 70%] VerifyingApplication
[ 75%] CreatingContainer
[ 80%] InstallingApplication
[ 85%] PostflightingApplication
[ 90%] SandboxingApplication
[ 95%] GeneratingApplicationMap
[100%] Installed package /Users/jenil/Work/.../oto.app
Device Name: (null)
Model Name: Unknown Device
------ Debug phase ------
Cannot debug (8804f10b43da1ss) over WIFI.

@jenil
Copy link

jenil commented Nov 5, 2015

Hey @shazron did you get a chance to take a look at this?

@jcworsley
Copy link

Hey all, just ran into this myself and submitted a fix in a pull request (#192) from my fork. Hope it helps someone.

@markghayden
Copy link

Also appear to be running into this problem. I can confirm turning off wifi on the device serves as a work-around.

@shazron shazron modified the milestones: 2.0.0, 1.8.0, 1.8.3 Nov 24, 2015
@shazron
Copy link

shazron commented Nov 24, 2015

Merged #192 for 1.8.3 release (soon).

@shazron
Copy link

shazron commented Nov 24, 2015

1.8.3 published, give it a go.

@Coder-256
Copy link

I was having a similar issue, but restarting the device fixed it.

@endel
Copy link

endel commented Jun 15, 2018

Unplugging the device from USB and plugging again solved for me.

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

No branches or pull requests