如何在开发环境测试Adjust SDK追踪URL跳转至开发版APP
Great question! I’ve dealt with similar scenarios when testing Adjust tracking links for adhoc/development builds before, so let’s walk through the solutions step by step to get your test builds behaving the way you want.
1. Match Bundle IDs Between Test and Production Builds
iOS identifies apps by their Bundle ID first—even if the signing profile differs (development/adhoc vs. App Store). If your test build uses a modified Bundle ID (e.g., adding .dev), the system will treat it as a completely separate app, so opening the production tracker URL won’t detect the test build installed on your device.
Fix:
- Ensure your development/adhoc Xcode target uses the exact same Bundle ID as your production app. Double-check this in your target’s "Signing & Capabilities" tab.
2. Configure Consistent URL Schemes
For the tracker URL to directly open your test build, you need the same URL Scheme configured in both test and production builds. This is how iOS knows to launch your app instead of navigating to the App Store.
Add to Info.plist:
<key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLSchemes</key> <array> <string>your-custom-app-scheme</string> </array> </dict> </array>
Replace your-custom-app-scheme with the scheme you’ve set up in Adjust’s dashboard for your app.
3. Adjust SDK Environment Configuration
Adjust’s environment setting affects where attribution data is sent, but it can also influence how tracker links behave. For test builds, you can toggle the environment to match production (or keep it sandboxed for testing data) depending on your needs.
Code Example (AppDelegate):
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Initialize Adjust ADJConfig *config = [ADJConfig configWithAppToken:@"your-app-token" environment:ADJEnvironmentSandbox]; // Override environment for adhoc builds (if needed) #if ADHOC_BUILD [config setEnvironment:ADJEnvironmentProduction]; #endif [Adjust appDidLaunch:config]; return YES; }
Note: Define the ADHOC_BUILD macro in your Xcode build settings under "Preprocessor Macros" for adhoc targets.
4. Custom Deeplink Handling in Adjust Delegate
If the default system behavior still isn’t detecting your test build, you can manually intercept the tracker’s deeplink in the Adjust attribution delegate and force-launch your app.
Code Example:
- (void)adjustAttributionChanged:(ADJAttribution *)attribution { // Check if we're running a test build #if TARGET_IPHONE_SIMULATOR || DEBUG || ADHOC_BUILD NSString *deeplinkURLString = attribution.deeplink; if (deeplinkURLString) { NSURL *deeplinkURL = [NSURL URLWithString:deeplinkURLString]; // Try to open the deeplink in our app first if ([[UIApplication sharedApplication] canOpenURL:deeplinkURL]) { [[UIApplication sharedApplication] openURL:deeplinkURL options:@{} completionHandler:^(BOOL success) { if (success) { NSLog(@"Successfully opened deeplink in test build"); } }]; return; // Skip default App Store redirect } } #endif // Let production builds follow the default App Store redirect logic }
This way, test builds will prioritize opening the local app instead of redirecting to the App Store.
5. Use Adjust Test Trackers
For dedicated testing, create a test tracker in the Adjust dashboard. Configure this tracker to link directly to your app’s URL scheme instead of the App Store page. This ensures your test links always launch the development/adhoc build without touching the App Store.
- Make sure your adhoc provisioning profile includes the device you’re testing on.
- Restart your device if the App Store still shows "Get" instead of "Open"—iOS sometimes caches app installation status.
内容的提问来源于stack exchange,提问作者Usman Mughal




