How to run earlgrey tests for Chromium IOS on the device?

249 views
Skip to first unread message

Igor Kaplan

unread,
Nov 11, 2017, 10:47:26 AM11/11/17
to Chromium-dev
Dear Chromium developers.
  I apologise, if I am posting this question in the wrong group, please let me know, which group would be more appropriate.

  Would like to ask , if someone could advise me please, how to run chromium for IOS earlgrey tests on the physical device instead of IOS simulator.
  I have the Chromium for IOS build environment, where I successfully build Chromium and all tests.
  I am able to install chromium on the device without any problems and also able to run earlgrey tests on the simulator using iossim utility, which comes with chromium.
  Looking at the chromium for IOS build instructions at
https://chromium.googlesource.com/chromium/src/+/lkcr/docs/ios/build_instructions.md
I see the following:

EarlGrey tests are run differently than other test targets, as there is an XCTest bundle that is injected into the target application. Therefore you must
also pass in the test bundle:

$ out/Debug-iphonesimulator/iossim \
    out/Debug-iphonesimulator/ios_chrome_ui_egtests.app \
    out/Debug-iphonesimulator/ios_chrome_ui_egtests.app/PlugIns/ios_chrome_ui_egtests_module.xctest

That works fine for the simulator.
  I tried to create the xml file manually and to run the following xcodebuild command to run the test on my iPhone instead:
xcodebuild -xctestrun /Volumes/samsung/test-device.xml \
-destination 'platform=iOS,id=32f2df369e9f8145ccc70791f5d1932f8a82f80e' \
test-without-building

Here is my test-device.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>TestTargetName</key>
 <dict>
  <key>TestBundlePath</key>
  <string>/Volumes/samsung/git/src/out/Release-iphoneos/ios_chrome_ui_egtests.app/PlugIns/ios_chrome_ui_egtests_module.xctest</string>
  <key>TestHostPath</key>
  <string>/Volumes/samsung/git/src/out/Release-iphoneos/ios_chrome_ui_egtests.app</string>
  <key>TestingEnvironmentVariables</key>
  <dict>
   <key>DYLD_FRAMEWORK_PATH</key>
   <string>__PLATFORMS__/iPhoneOS.platform/Developer/Library/Frameworks</string>
   <key>DYLD_INSERT_LIBRARIES</key>
   <string>__PLATFORMS__/iPhoneOS.platform/Developer/Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection</string>
   <key>DYLD_LIBRARY_PATH</key>
   <string>__PLATFORMS__/iPhoneOS.platform/Developer/Library</string>
   <key>IDEiPhoneInternalTestBundleName</key>
   <string>ios_chrome_ui_egtests.app</string>
  </dict>
 </dict>
</dict>
</plist>

When I run the command above I get the message:
User defaults from command line:
IDETestRunSpecificationPath = /Volumes/samsung/test-device.xml
xcodebuild: error: Failed to build workspace temporary with scheme Transient Testing.
Reason: Logic Testing Unavailable

I was searching on the web for this error, did not find anything useful.
  I have sent the same question to the earlgrey developers group, was told that earlgrey should run on device, so probably I am doing somaething incorrectly.
  Will greatly appreciate, if you tell me, how to run Chromium earlgrey tests on device.
  My environment is Mac os 10.12, xcode 9.1, Chromium 62

  Many thanks and have a wonderful day!

  Igor.

林振章

unread,
Nov 11, 2017, 9:01:49 PM11/11/17
to igork...@gmail.com, Chromium-dev
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/a57e432e-45bb-4e45-bd12-62bb23f6ba9f%40chromium.org.

George Burgess

unread,
Nov 11, 2017, 9:32:57 PM11/11/17
to a0907...@gmail.com, igork...@gmail.com, Chromium-dev
Sorry for going off-topic, but 林振章: it looks like you've sent 11 empty replies to seemingly-arbitrary threads over the last two days. Can you please stop doing that?

Thank you,
George

林振章

unread,
Nov 12, 2017, 12:26:16 AM11/12/17
to George Burgess, igork...@gmail.com, Chromium-dev

林振章

unread,
Nov 12, 2017, 5:23:04 AM11/12/17
to George Burgess, Chromium-dev, Igor Kaplan

林振章

unread,
Nov 12, 2017, 5:28:54 AM11/12/17
to George Burgess, Chromium-dev, Igor Kaplan

Sylvain Defresne

unread,
Nov 13, 2017, 5:01:42 AM11/13/17
to igork...@gmail.com, chromi...@chromium.org
Can you try running the EarlGrey tests from Xcode on a device? This is how all developer do it, so it should work.

I've never tried running manually via xcodebuild, so I don't know whether the issue is in your XML configuration file or whether it is due to our build.

Getting the information on whether it works via Xcode will help check that there is no misconfiguration.
-- Sylvain


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.

Menglu Huang

unread,
Nov 13, 2017, 1:17:01 PM11/13/17
to sdef...@chromium.org, igork...@gmail.com, chromi...@chromium.org
The xml file for simulators and devices should be slightly different.  Try adding "IsAppHostedTestBundle".  Sorry I don't have an example file at hand and just edited yours,  could be wrong.

Also you can run without an xml file on command line if it's for local development testing: 
xcodebuild -workspace out/build/all.workspace -scheme ios_chrome_ui_egtests \
-destination 'id=32f2df369e9f8145ccc70791f5d1932f8a82f80e' \
test-without-building


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>TestTargetName</key>
 <dict>
  <key>IsAppHostedTestBundle</key>
  <true/>
  <key>TestBundlePath</key>
  <string>/Volumes/samsung/git/src/out/Release-iphoneos/ios_chrome_ui_egtests.app/PlugIns/ios_chrome_ui_egtests_module.xctest</string>
  <key>TestHostPath</key>
  <string>/Volumes/samsung/git/src/out/Release-iphoneos/ios_chrome_ui_egtests.app</string>
  <key>TestingEnvironmentVariables</key>
  <dict>
   <key>DYLD_FRAMEWORK_PATH</key>
   <string>__PLATFORMS__/iPhoneOS.platform/Developer/Library/Frameworks</string>
   <key>DYLD_INSERT_LIBRARIES</key>
   <string>__PLATFORMS__/iPhoneOS.platform/Developer/Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection</string>
   <key>DYLD_LIBRARY_PATH</key>
   <string>__PLATFORMS__/iPhoneOS.platform/Developer/Library</string>
   <key>XCInjectBundleInto</key>
   <string>__TESTHOST__/ios_chrome_ui_egtests</string>
  </dict>
 </dict>
</dict>
</plist>


To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.

Igor Kaplan

unread,
Nov 13, 2017, 5:06:53 PM11/13/17
to Chromium-dev, sdef...@chromium.org, igork...@gmail.com
Hi Menglu,
  Thanks so much, your xml corrections worked, tests run on my iPhone with no problems!

  Many thanks for all replys

  Igor.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

Shu Dong

unread,
Nov 13, 2017, 9:39:58 PM11/13/17
to Chromium-dev, sdef...@chromium.org, igork...@gmail.com
I was wrong in the device debugging showcase pro: no mobile provisioning profile found for "$(PRODUCT_BUNDLE_IDENTIFIER)"
please help me,thank you
Reply all
Reply to author
Forward
0 new messages