Xcode cannot connect to wkwebbview process - ios

I am debugging a cordova app and suspecting a memory issue, using too much when loading images for upload.
I can connect the debugger to the app and watch the disk I/O as the large images are loaded. The memory footprint for the app stays the same as expected, see below.
The images should reside in the wkwebview in the app, and that should be running in a separate com.apple.WebKit.WebContent process. I cannot connect to that process from the Xcode debugger, I get the following error
Could not attach to pid : “32335”
Domain: IDEDebugSessionErrorDomain
Code: 3
Failure Reason: attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries when the attached failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.)
In Console.app, debugserver reports:
1 +0.000000 sec [7edb/0103]: error: ::task_for_pid ( target_tport = 0x0203, pid = 32335, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0203, pid = 32335, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
leading to https://developer.apple.com/forums/thread/694700
I have tried the suggestions in the link to no avail.
sudo DevToolsSecurity -enable
deleting the cerificates in ~/Library/MobileDevice/Provisioning\ Profiles (new ones are generated automatically)
my build.json contains the suggested settings:
"ios": {
"debug": {
"codeSignIdentity": "iPhone Developer",
"developmentTeam": "P9Q2VE5DWW",
"packageType": "development",
"automaticProvisioning": true,
"buildFlag": [
"EMBEDDED_CONTENT_CONTAINS_SWIFT=YES",
"DEPLOYMENT_POSTPROCESSING=NO",
"CODE_SIGN_INJECT_BASE_ENTITLEMENTS=YES",
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO",
"LD_RUNPATH_SEARCH_PATHS = \"#executable_path/Frameworks\""
]
},
Is there anything else I can try, and is it even possible to connect to the separate com.apple.WebKit.WebContent process?

Debugging on macOS and other Darwin systems is on an opt-in basis. If an app or helper tool does not choose to be debuggable, then you can't debug it, and you get the error that you have shown. This is for security reasons, and all the system binaries on macOS mark themselves as non-debuggable.
This access is controlled by "SIP" - System Integrity Protection, so you will need to defang that to some extent to debug system processes. This thread discusses how to disable just the debugging protections:
https://discussions.apple.com/thread/251326883

Related

createMinToInstruction authorized by PDA, works fine in LocalNet, but gives "Account not associated with this Mint" when run on DevNet

I create an automate deployment script that will mint 2million SPL tokens to an address, the mint is owned by the program PDA as shown in Solana explorer:
Bellow is the last step in the deployment script:
export async function mint2e6Tokens(provider: anchor.AnchorProvider, tokenAccount: PublicKey, mint: PublicKey): Promise<void> {
// get the token account could be PDA
const programKeypair = await createKeypairFromFile(PROGRAM_KEYPAIR_PATH);
/** Load from PDA */
let mint_tokens_tx = new Transaction().add(
createMintToInstruction(
mint,
tokenAccount,
programKeypair.publicKey, // -> I DOUBLE CHECKED, THIS IS 6Z24B3qCrWfWvDo1f2HgxmnBSGhqQes1sHobqMtMxfbP
2e6,
[],
TOKEN_PROGRAM_ID
)
);
// We sign with our programId instead of the wallet because this is a PDA
// Program Derived Adress
await provider.sendAndConfirm(mint_tokens_tx, [programKeypair]);
}
When I run in LocalNet, it works:
Migrating to LocalNet...
RUNNING CUSTOM SCRIPT ====>>>
Payper: EsgJ9ihTEZskWyWpMMPuGVisy5ay76YWgetgTLb3jRmj
Using program 6Z24B3qCrWfWvDo1f2HgxmnBSGhqQes1sHobqMtMxfbP
Program: 6Z24B3qCrWfWvDo1f2HgxmnBSGhqQes1sHobqMtMxfbP
Mint: AVPgrT1y6ZfjGWPyLCWEPZdogRgmEMbrdRbcHNSfAPzF
Campaign: FcAmyEgZsXUKLB6hKufDmLuSBzMzVtPmRPm7vZLStK4U
31999500
However when I switch to DevNet, it always give me error
Migrating to DevNet...
RUNNING CUSTOM SCRIPT ====>>>
Payper: EsgJ9ihTEZskWyWpMMPuGVisy5ay76YWgetgTLb3jRmj
Using program 6Z24B3qCrWfWvDo1f2HgxmnBSGhqQes1sHobqMtMxfbP
Program: 6Z24B3qCrWfWvDo1f2HgxmnBSGhqQes1sHobqMtMxfbP
Mint: AVPgrT1y6ZfjGWPyLCWEPZdogRgmEMbrdRbcHNSfAPzF
Campaign: FcAmyEgZsXUKLB6hKufDmLuSBzMzVtPmRPm7vZLStK4U
SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x3
at Connection.sendEncodedTransaction (/code/beens/node_modules/#solana/web3.js/src/connection.ts:4248:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Connection.sendRawTransaction (/code/beens/node_modules/#solana/web3.js/src/connection.ts:4210:20)
at async sendAndConfirmRawTransaction (/code/beens/node_modules/#project-serum/anchor/src/provider.ts:288:21)
at async AnchorProvider.sendAndConfirm (/code/beens/node_modules/#project-serum/anchor/src/provider.ts:148:14) {
logs: [
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]',
'Program log: Instruction: MintTo',
'Program log: Error: Account not associated with this Mint',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2809 of 200000 compute units',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA failed: custom program error: 0x3'
]
}
Why the authority is right, but Solana complain that Error: Account not associated with this Mint?
It turns out that my versions for Solana, Anchor and Rust are not compatible with DevNet and / or testnet.
I upgrade solana to main net recommended version and it works. One more things to mention that don't forget to run "solana program close --buffers" before trying. My current settings are:
root#d4c64206ce03:/code# solana --version
solana-cli 1.10.31 (src:77a40cd8; feat:4192065167)
root#d4c64206ce03:/code# rustc --version
rustc 1.63.0 (4b91a6ea7 2022-08-08)
root#d4c64206ce03:/code# anchor --version
anchor-cli 0.25.0

ipa upload to Testflight fails via Jenkins but passes via terminal

So I have been trying to automate ipa uploads to Testflight via Jenkins. I am using the following command to achieve the same :
xcodebuild -exportArchive -archivePath Archive/application.xcarchive -exportPath Builds -exportOptionsPlist ~/Desktop/jenkins_slave/AppstoreExportOptions.plist -quiet
When executed via terminal, it works fine and the ipa is uploaded to Testflight.
However, when I am running via Jenkins, the upload fails citing authentication error.
Logs below :
2022-01-10 17:58:24.681 xcodebuild[14144:25274615] DVTPortal: Error:
Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." UserInfo={payload={
creationTimestamp = "2022-01-10T17:58:24Z";
httpCode = 200;
protocolVersion = QH65B2;
requestUrl = "https://developerservices2.apple.com/services/QH65B2/viewDeveloper.action";
responseId = "207a4f29-2863-4dce-b290-7f28e845cc44";
resultCode = 1100;
resultString = "Your session has expired. Please log in.";
userLocale = "en_US";
userString = "Your session has expired. Please log in.";
}, NSLocalizedDescription=Your session has expired. Please log in.}
2022-01-10 17:58:24.682 xcodebuild[14144:25274618] IDEDistribution: Failed to log in with account 'xyz#gmail.com' while checking for an App Store Connect account
error: exportArchive: Failed to log in.
Error Domain=IDEDistributionErrorDomain Code=9 "Failed to log in." UserInfo={IDEDistributionErrorsAccountIssues=(
"Account \"xyz#gmail.com\": Failed to log in"
), NSLocalizedDescription=Failed to log in., NSLocalizedRecoverySuggestion=App Store Connect access for “Company xyz.” is required. Ensure that your Apple ID account usernames and passwords are correct in the Accounts preference pane.}
I can't figure out what is going wrong. I have already tried the following as mentioned in numerous places, but it still doesn't work :
defaults write com.apple.dt.Xcode DVTDeveloperAccountUseKeychainService_2 -bool NO
I know you'll would suggest to use fastlane to achieve this faster and effectively. Eventually I would integrate fastlane in my project, but I want to understand what is going wrong here.

Appium inspector resets permissions for app on Android

When I start Appium inspector on Windows 10 for Android 10, my App shuts down and restarts with reset permissions, that is it asks me if the app needs access to camera, video, location, etc though these permissions were already given. It also removes the license file from my app. Any idea why this happens?
Following are my Desired capabilities:
{
"platformName": "Android",
"platformVersion": "10.0",
"deviceName": "R52N20ALVDN",
"udid": "R52N20ALVDN",
"appPackage": "Nap.CP.Android",
"automationName": "uiautomator2",
"appActivity": "crc6429e3927486beccbc.ActivityLicenseBrowse"
}
The uiautomatorviewer works fine. I tried changing the activity from:
"appActivity": "crc6429e3927486beccbc.ActivityLicenseBrowse"
To:
"appActivity": "crc6429e3927486beccbc.ActivityLogin"
And got the following error:
Error
An unknown server-side error occurred while processing the command. Original error: Cannot start the 'Nap.CP.Android' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: 'Command 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe
-P 5037 -s R52N20ALVDN shell am start -W -n Nap.CP.Android/crc6429e3927486beccbc.ActivityLogin -S' exited with code 255'; Stderr: 'Security exception: Permission Denial: starting Intent { flg=0x10000000 cmp=Nap.CP.Android/crc6429e3927486beccbc.ActivityLogin } from null (pid=31202, uid=2000) not exported from uid 10286 java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=Nap.CP.Android/crc6429e3927486beccbc.ActivityLogin } from null (pid=31202, uid=2000) not exported from uid 10286 at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1447) at com.android.server.wm.ActivityStarter.startActivity(ActivityStarter.java:978) at com.android.server.wm.ActivityStarter.startActivity(ActivityStarter.java:732) at com.android.server.wm.ActivityStarter.startActivityMayWait(ActivityStarter.java:2072) at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:646) at com.android.server.wm.ActivityTaskManagerService.startActivityAndWait(ActivityTaskManagerService.java:1893) at com.android.server.am.ActivityManagerService.startActivityAndWait(ActivityManagerService.java:4269) at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:513) at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:172) at android.os.ShellCommand.exec(ShellCommand.java:104) at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:12424) at android.os.Binder.shellCommand(Binder.java:916) at android.os.Binder.onTransact(Binder.java:790) at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:5475) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3426) at android.os.Binder.execTransactInternal(Binder.java:1056) at android.os.Binder.execTransact(Binder.java:1029)'; Code: '255'
And it again resets the permissions as before in addition to giving above error.
Inspector was working fine when I tried it at my workplace but failure showed up when I tried the same from home, though other than the network ie wi-fi at home, nothing has changed. The Desired capabilities were also the same.
You can use this in your capabilities to allow permissions at app start :
autoGrantPermissions:true
noReset:False
It will allow all permission to the app and will not reset the app at startup.

intermittently occuring appium unknown server-side error

I seem to get this issue intermittently. no error if i were to un plug and replug the devices and re-excuite the test, however this is only temperory fix till the time it shows up again.
i have 2 instances of appium server for 2 devices-
server1
Host-0.0.0.0
server port-5050
Bootstrap port- 4734
allow session overrides- ticked
server2
Host-0.0.0.0
server port-4723
Bootstrap port- 4724
allow session overrides- ticked
appium version- 1.15.1
List of devices attached-
52002dd24392b5a1 device
5200472dec01a4a9 device
error on appium server console-
W3C] Encountered internal error running command: Error: Cannot start the 'com.XYZ.XYZ' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: 'Command ''C:\\Users\\XYZ\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe' -P 5037 -s 5200472dec01a4a9 shell am start -W -n com.XYZ.XYZ/host.exp.exponent.LauncherActivity -S' timed out after 120000ms'. Try to increase the 120000ms adb execution timeout represented by 'adbExecTimeout' capability
[W3C] at ADB.startApp (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:153:11)
[HTTP] <-- POST /wd/hub/session 500 132866 ms - 1782
[HTTP]
[Instrumentation] .
[Instrumentation] Time: 123.085
[Instrumentation]
[Instrumentation] OK (1 test)
[Instrumentation] The process has exited with code 0
error on IDE-
org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.XYZ.XYZ' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: 'Command ''C:\\Users\\XYZ\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe' -P 5037 -s 5200472dec01a4a9 shell am start -W -n com.XYZ.XYZ/host.exp.exponent.LauncherActivity -S' timed out after 120000ms'. Try to increase the 120000ms adb execution timeout represented by 'adbExecTimeout' capability
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.XYZ.XYZ' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: 'Command ''C:\\Users\\XYZ\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe' -P 5037 -s 5200472dec01a4a9 shell am start -W -n com.XYZ.XYZ/host.exp.exponent.LauncherActivity -S' timed out after 120000ms'. Try to increase the 120000ms adb execution timeout represented by 'adbExecTimeout' capability
desired capabilities for device1-
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "Tab");
capabilities.setCapability("platformVersion", "8.0.0");
capabilities.setCapability("platformName", "ANDROID");
capabilities.setCapability("udid", "5200472dec01a4a9");
capabilities.setCapability("noReset", "true");
capabilities.setCapability("appPackage", "com.xyz.xyz");
capabilities.setCapability("appActivity", "host.exp.exponent.LauncherActivity");
capabilities.setCapability("adbExecTimeout", 120000);
capabilities.setCapability("newCommandTimeout", 3000);
capabilities.setCapability("noSign", "true");
URL mobileURL = new URL("http://0.0.0.0:5050/wd/hub");
mobileParent = new AndroidDriver(mobileURL, capabilities);
mobile capabilities for device2-
capabilities.setCapability("deviceName", "Tab");
capabilities.setCapability("platformVersion", "8.0.0");
capabilities.setCapability("platformName", "ANDROID");
capabilities.setCapability("udid", "52002dd24392b5a1");
capabilities.setCapability("noReset", "true");
capabilities.setCapability("appPackage", "com.coachhire.kura");
capabilities.setCapability("appActivity", "host.exp.exponent.LauncherActivity");
capabilities.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS, true);
capabilities.setCapability("adbExecTimeout", 120000);
capabilities.setCapability("newCommandTimeout", 3000);
capabilities.setCapability("noSign", "true");
URL mobileURL = new URL("http://0.0.0.0:4723/wd/hub");
mobileDriver = new AndroidDriver(mobileURL, capabilities);
any help greatly appretiated!
Looking at the details you have provided, there should not be any errors. It should work fine.
Unknown error usually accrues when Appium not able to figure out the list of capabilities provided for the run. I would suggest double check appPackage and appActivity details are right.
Also, try to run tests on one devices and see any errors. see the consistency of test run. if not errors than you can add one more device and see how it goes.
Add below in the capabilities,
"automationName": "UiAutomator2"
If you are running test on local machine use http://127.0.0.1:<Port>/wd/hubinstead 0.0.0.0
If you are running tests remotely make sure in above, local IP 127.0.0.0 replaced with the machine IP where Appium server is running.
As you are running Android devices only, I hope prerequisites softwares are installed as per Android test setup.
For mac device setup, follow steps here - https://www.swtestacademy.com/how-to-install-appium-on-mac/
Try below steps,
Check you can install the app manually by running below command.
adb -P <port> -s <device id > shell pm install -t -g <apk path>
If this could work, it indicates that there are no issues with the device. Else, you should reset the device and re test it.
Check Appium server is running with no issues. and access this link and see you get 200 response on appium server console.
http://<appium server ip>:4723/wd/hub/sessions
If you see an error there, it indicates that there is an issue with Appium. Un-install and install stable version of Appium and re test.
You should know that sometimes Node.js could not talk to 127.0.0.1:4723, So use 0.0.0.0:4723 instead and visa versa. Remember to change this in both code (DesiredCapabilities) and appium setting.
Try "udid" parametre is required for desired capabilities -
Example, caps.setCapability("udid", "ce0217124184c72505"); //DeviceId from "adb devices" command

Windows IoT error on driver install: Could not start update, (0x8024A10F)

I created .cab package using a manual: https://learn.microsoft.com/en-us/windows/iot-core/learn-about-hardware/peripheraldrivers
I copied the file, staged the update, but get error on commit:
[192.168.1.17]: PS C:\Data\USERS\DefaultAccount\Documents> applyupdate -stage .\Contoso.Drivers.oem6.cab
Microsoft (C) C:\windows\system32\ApplyUpdate.exe
INFO: Start staging .\Contoso.Drivers.oem6.cab
INFO: UpdateStateIdle
INFO: Check status...
INFO: No past issues to report
INFO: ProgressStateNone: 0
INFO: Shared data folder found: C:\Data\ProgramData\USOShared\Data
INFO: Copying file: .\Contoso.Drivers.oem6.cab
INFO: Staging succeeded
SUCCESS: Staging succeeded
[192.168.1.17]: PS C:\Data\USERS\DefaultAccount\Documents> applyupdate -commit
Microsoft (C) C:\windows\system32\ApplyUpdate.exe
INFO: Start commit
INFO: UpdateStateIdle
INFO: Check status...
INFO: No past issues to report
INFO: Starting component installation...
applyupdate : ERROR: Could not start update, (0x8024A10F)
+ CategoryInfo : NotSpecified: (ERROR: Could no...e, (0x8024A10F):String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
ERROR: Windows Update is already in progress. Please try again after it has finished.
INFO: ProgressStateNone: 0
ERROR: Commit Failed
[192.168.1.17]: PS C:\Data\USERS\DefaultAccount\Documents>
Reboot of the device don't perform the update, no new device in device manger in Windows Device Portal...
What can be a problem?
UPDATE
The problem is about stack updating process: Failed to install CAB file as device is in the middle of an update
UPDATE
Here is the header of the .inf driver file form PC.
[version]
signature="$CHICAGO$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%PRO%
DriverVer=10/01/2018,3.8.28.0
;DLL Ver=08/29/2017,1.0.0.5
CatalogFile=ser2pl.cat
Currently I have two ways to solve the problem:
To solve update problem
To use onboard UART port
In the second way I also have problem, I have null in the SerialPort:
string aqs = SerialDevice.GetDeviceSelector();
DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(aqs);
List<DeviceInformation> list = devices.ToList();
DeviceInformation di = list.First();
serialPort = await SerialDevice.FromIdAsync(di.Id);
serialPort is null
di.Id equals: Id "\\\\?\\ACPI#BCM2836#0#{86e0d1e0-8089-11d0-9ce4-08003e301f73}" string
list.Count equal 1
UPDATE
Here is the question about problem with onboard UART:
Unable to open UART port on Windows IoT with Raspberry Pi 3
UPDATE
I reflashed the device, but have same problem with updates. I have device several hours on, and it still downloads the updates:
Current OS Version: 10.0.17763.107
Downloading updates.
Last checked: 2019-02-14 at 08:10

Resources